-
Notifications
You must be signed in to change notification settings - Fork 128
Closed
Labels
bugSomething not working correctlySomething not working correctlyenumsIssues related to enumsIssues related to enumsrenamerIssues related to scoping and name resolution.Issues related to scoping and name resolution.typecheckerIssues related to type-checking Cryptol code.Issues related to type-checking Cryptol code.
Description
On the sum-types branch (#1602), there are some places in the code that are missing cases for PTyped and PLocated. These include:
-
The
BindsName (Pattern PName)instance:cryptol/src/Cryptol/ModuleSystem/Binds.hs
Lines 416 to 424 in 221bf4a
instance BindsNames (Pattern PName) where namingEnv pat = case pat of PVar x -> BuildNamingEnv ( do y <- newLocal NSValue (thing x) (srcRange x) pure (singletonNS NSValue (thing x) y) ) PCon _ xs -> mconcat (map namingEnv xs) _ -> panic "namingEnv" ["Unexpected pattern"] -
The
checkCaseAltfunction:cryptol/src/Cryptol/ModuleSystem/Binds.hs
Lines 416 to 424 in 221bf4a
instance BindsNames (Pattern PName) where namingEnv pat = case pat of PVar x -> BuildNamingEnv ( do y <- newLocal NSValue (thing x) (srcRange x) pure (singletonNS NSValue (thing x) y) ) PCon _ xs -> mconcat (map namingEnv xs) _ -> panic "namingEnv" ["Unexpected pattern"]
There may be others—check to see if -Wincomplete-patterns warns about other missing cases for PTyped and PLocated.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething not working correctlySomething not working correctlyenumsIssues related to enumsIssues related to enumsrenamerIssues related to scoping and name resolution.Issues related to scoping and name resolution.typecheckerIssues related to type-checking Cryptol code.Issues related to type-checking Cryptol code.