diff --git a/frontends/RainPasses.hs b/frontends/RainPasses.hs index e858738..7e021e7 100644 --- a/frontends/RainPasses.hs +++ b/frontends/RainPasses.hs @@ -45,7 +45,8 @@ rainPasses = makePassesDep' ((== FrontendRain) . csFrontend) uniquifyAndResolveVars, [Prop.noInt], namesDone) ,("Fold all constant expressions", constantFoldPass, [Prop.noInt] ++ namesDone, [Prop.constantsFolded, Prop.constantsChecked]) - ,("Annotate integer literal types", annnotateIntLiteralTypes, [Prop.noInt] ++ namesDone, [Prop.intLiteralsInBounds]) + ,("Annotate integer literal types", annotateIntLiteralTypes, [Prop.noInt] ++ namesDone, [Prop.intLiteralsInBounds]) + ,("Record inferred name types in dictionary", recordInfNameTypes, namesDone ++ [Prop.intLiteralsInBounds], [Prop.inferredTypesRecorded]) diff --git a/frontends/RainTypes.hs b/frontends/RainTypes.hs index f6c18ef..15f67c3 100644 --- a/frontends/RainTypes.hs +++ b/frontends/RainTypes.hs @@ -56,7 +56,7 @@ constantFoldPass = applyDepthM doExpression -- | Annotates all integer literal types annnotateIntLiteralTypes :: Data t => t -> PassM t -annnotateIntLiteralTypes = applyDepthM doExpression +annnotateIntLiteralTypes = everywhereASTM doExpression where --Function is separated out to easily provide the type description of Integer powOf2 :: Integer -> Integer diff --git a/frontends/RainTypesTest.hs b/frontends/RainTypesTest.hs index daf3d11..3c2f396 100644 --- a/frontends/RainTypesTest.hs +++ b/frontends/RainTypesTest.hs @@ -96,9 +96,9 @@ annotateIntTest = TestList where signed :: A.Type -> Integer -> Test signed t n = TestCase $ testPass ("annotateIntTest: " ++ show n) (tag3 A.Literal DontCare t $ tag2 A.IntLiteral DontCare (show n)) - (annnotateIntLiteralTypes $ int64Literal n) (return ()) + (annotateIntLiteralTypes $ int64Literal n) (return ()) failSigned :: Integer -> Test - failSigned n = TestCase $ testPassShouldFail ("annotateIntTest: " ++ show n) (annnotateIntLiteralTypes $ int64Literal n) (return ()) + failSigned n = TestCase $ testPassShouldFail ("annotateIntTest: " ++ show n) (annotateIntLiteralTypes $ int64Literal n) (return ()) annotateListLiteralTest :: Test