-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: subtype check for literal and union types (#1288)
### Summary of Changes Previously, the type checker incorrectly showed an error in the following program at the call marked with the arrow: ``` package bug @pure fun bug1(p: union<Int, String>) @pure fun bug2() -> r: literal<1, ""> pipeline bug3 { val a = bug2(); bug1(a); // <---- } ``` This was caused because the quantifiers when comparing literal and union types were in the wrong order: - We checked whether there was an option in the union type that all constants of the literal type could be assigned to. - Now we check whether, for each constant of the literal type, there is an option in the union type they could be assigned to.
- Loading branch information
1 parent
3880bfe
commit 911881c
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters