@@ -106,6 +106,7 @@ data CheckFailureNoLoc
106106 | SmtFailure SmtFailure
107107 deriving (Eq , Show )
108108
109+ -- TODO: change Parsed to Info if possible
109110data CheckFailure = CheckFailure
110111 { _checkFailureParsed :: ! Parsed
111112 , _checkFailure :: ! CheckFailureNoLoc
@@ -160,8 +161,8 @@ describeCheckResult :: CheckResult -> Text
160161describeCheckResult = either describeCheckFailure describeCheckSuccess
161162
162163translateToCheckFailure :: TranslateFailure -> CheckFailure
163- translateToCheckFailure (TranslateFailure parsed err)
164- = CheckFailure parsed (TranslateFailure' err)
164+ translateToCheckFailure (TranslateFailure info err)
165+ = CheckFailure (getInfoParsed info) (TranslateFailure' err)
165166
166167analyzeToCheckFailure :: AnalyzeFailure -> CheckFailure
167168analyzeToCheckFailure (AnalyzeFailure parsed err)
@@ -396,9 +397,7 @@ checkFunctionInvariants
396397 -> IO (Either CheckFailure (TableMap [CheckResult ]))
397398checkFunctionInvariants tables info pactArgs body = runExceptT $ do
398399 (args, tm, tagAllocs) <- hoist generalize $
399- -- TODO: runTranslation would ideally give us info about exactly where
400- -- the translation failed. This is as close as we can get currently.
401- withExcept translateToCheckFailure $ runTranslation pactArgs body
400+ withExcept translateToCheckFailure $ runTranslation info pactArgs body
402401
403402 ExceptT $ catchingExceptions $ runSymbolic $ runExceptT $ do
404403 tags <- lift $ allocModelTags info args tm tagAllocs
@@ -465,7 +464,7 @@ checkFunction
465464checkFunction tables info parsed pactArgs body check = runExceptT $ do
466465 (args, tm, tagAllocs) <- hoist generalize $
467466 withExcept translateToCheckFailure $
468- runTranslation pactArgs body
467+ runTranslation info pactArgs body
469468
470469 ExceptT $ catchingExceptions $ runSymbolic $ runExceptT $ do
471470 tags <- lift $ allocModelTags info args tm tagAllocs
0 commit comments