Skip to content

Commit

Permalink
Don't get rid of constraints when we print
Browse files Browse the repository at this point in the history
  • Loading branch information
ionathanch committed Sep 18, 2023
1 parent 8eadf7d commit 485aacb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Environment.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Environment
extendSourceLocation,
extendLevelConstraint,
simplify,
getConstraints,
dumpConstraints,
getSourceLocation,
err,
Expand Down Expand Up @@ -410,6 +411,9 @@ extendLevelConstraint c = do
-- if c `elem` cs then return () else
put $ TcState { constraints = (head locs,c) : cs }

getConstraints :: (MonadState TcState m) => m [(SourceLocation,LevelConstraint)]
getConstraints = gets constraints

dumpConstraints :: (MonadState TcState m) => m [(SourceLocation,LevelConstraint)]
dumpConstraints = do
st <- get
Expand Down
2 changes: 1 addition & 1 deletion src/TypeCheck.hs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ tcTerm LetPair{} _ k = Env.err [DS "The parser for 'full' expands Sigmas into d

tcTerm PrintMe (Just ty) mk = do
gamma <- Env.getLocalCtx
cs <- Env.dumpConstraints
cs <- Env.getConstraints
let dcs = displayConstraints (Env.simplify cs)
Env.warn $ [DS "Unmet obligation.\nContext:", DD gamma,
DS "\nGoal:", DD ty, DS " @ ", DD mk,
Expand Down

0 comments on commit 485aacb

Please sign in to comment.