This commit is contained in:
Paul Chiusano 2023-08-17 17:38:48 -05:00
parent a824eb8308
commit 7f9db5f15b

View File

@ -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 =