-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Labels
Description
As pointed out in #50, typecheck_match() looks only at type IDs without actually checking the underlying type. This means that two identical types, such as:
let x: oneof<list<int>, list<string>> = []
let y: oneof<list<int>, list<string>> = []
would have different IDs and result in type mismatch.
Two possible solutions:
- Change
typecheck_match()to actually check the types properly - When creating a type, first check whether it's been created already and reuse its ID if so. This would ensure that different type IDs would point at different types.