Skip to content

Commit

Permalink
relaxed type-checking between an unnamed T and int:T
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun committed Dec 6, 2024
1 parent fcc382a commit e113b7b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Conjure/Language/Type.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ typeUnify (TypeInt t1) (TypeInt t2) = case ?typeCheckerMode of
RelaxedIntegerTags -> True
typeUnify (TypeEnum a) (TypeEnum b) = a == b
typeUnify (TypeUnnamed a) (TypeUnnamed b) = a == b
typeUnify (TypeUnnamed (Name a)) (TypeInt (TagUnnamed b)) = a == b
typeUnify (TypeInt (TagUnnamed b)) (TypeUnnamed (Name a)) = a == b
typeUnify (TypeTuple [TypeAny]) TypeTuple{} = True
typeUnify TypeTuple{} (TypeTuple [TypeAny]) = True
typeUnify (TypeTuple as) (TypeTuple bs) = (length as == length bs) && and (zipWith typeUnify as bs)
Expand Down

0 comments on commit e113b7b

Please sign in to comment.