From 7f9db5f15bdfcbd662731e1be61d456f24b49cec Mon Sep 17 00:00:00 2001 From: Paul Chiusano Date: Thu, 17 Aug 2023 17:38:48 -0500 Subject: [PATCH] comments --- parser-typechecker/src/Unison/Syntax/DeclPrinter.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs b/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs index a09819649..211b53642 100644 --- a/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs +++ b/parser-typechecker/src/Unison/Syntax/DeclPrinter.hs @@ -180,6 +180,10 @@ fieldNames env r name dd = do for accessors \(v, _a, trm) -> case Result.result (Typechecker.synthesize env Typechecker.PatternMatchCoverageCheckSwitch'Disabled typecheckingEnv trm) of Nothing -> Nothing + -- Note: Typechecker.synthesize doesn't normalize the output + -- type. We do so here using `Type.cleanup`, mirroring what's + -- done when typechecking a whole file and ensuring we get the + -- same inferred type. Just typ -> Just (v, trm, Type.cleanup typ) let hashes = Hashing.hashTermComponents (Map.fromList . fmap (\(v, trm, typ) -> (v, (trm, typ, ()))) $ accessorsWithTypes) let names =