@@ -51,7 +51,7 @@ fromPattern p = case p of
5151data ErrorType = ConstructorNotFound Var.Canonical
5252
5353checkModule :: [CanonicalAdt] -> Module exports CanonicalBody -> [(Either ErrorType MatchResult, Annotation.Region)]
54−checkModule adts (Module {body}) = checkBody body where
54+checkModule (Module {body, datatypes}) = checkBody body where
5555 checkBody :: CanonicalBody -> [(Either ErrorType MatchResult, Annotation.Region)]
5656 checkBody (CanonicalBody {program}) = checkExpr program
5757
@@ -86,7 +86,7 @@ checkModule adts (Module {body}) = checkBody body where
8686 m =
8787 Map.fromList $ concatMap (\adt@(_adtName, (_tyVars, ctors)) ->
8888 map (\(ctor,_args) -> (ctor, adt)) ctors)
89− adts
89+ datatypes
9090
9191 ctorToAdtExn :: Var.Canonical -> Either ErrorType CanonicalAdt
9292 ctorToAdtExn c = case ctorToAdt c of