-
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: simplification of union types (#897)
### Summary of Changes Consider the following program: ``` class C<T> { attr a: union<Int, T> } segment s(p: C<String>) { val v = p.a; } ``` Previously, the type of the placeholder `v` was inferred to be `String`, because we incorrectly simplified union types that contained entries that were not fully substituted. Here, we replaced the entry `Int` with `T`, since `Int` is a subtype of `T`. This can change, however, once we substitute `T`, as shown here. Now, we never consider types that are not fully substituted for replacement and compute the correct type `union<Int, String>`.
- Loading branch information
1 parent
b81bef9
commit 4c577a3
Showing
10 changed files
with
118 additions
and
250 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
Oops, something went wrong.