-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Re-lub also hard union types in simplify #20027
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
scala> def test[A, B](a: A, b: B): A | B = a | ||
def test[A, B](a: A, b: B): A | B | ||
scala> def d0 = test("string", 1) | ||
def d0: String | Int | ||
scala> def d1 = test(1, "string") | ||
def d1: Int | String | ||
scala> def d2 = test(d0, d1) | ||
def d2: String | Int | ||
scala> def d3 = test(d1, d0) | ||
def d3: Int | String | ||
scala> def d4 = test(d2, d3) | ||
def d4: String | Int | ||
scala> def d5 = test(d3, d2) | ||
def d5: Int | String | ||
scala> def d6 = test(d4, d5) | ||
def d6: String | Int |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
def test[A, B](a: A, b: B): A | B = a | ||
val v0 = test("string", 1) | ||
val v1 = test(1, "string") | ||
val v2 = test(v0, v1) | ||
val v3 = test(v1, v0) | ||
val v4 = test(v2, v3) | ||
val v5 = test(v3, v2) | ||
val v6 = test(v4, v5) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm glad the issue is being resolved, but I don't understand this test. How can we see that for instance the type of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now: manual inspection after -Xprint:typer. It would be good if someone could add a better test. We don't have good infrastructure for inferred types complexity yet. Maybe the presentation compiler tests have some of the necessary setup? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now this bit I had figured out! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great! That's a good idea to use repl tests for that. I added your test to the PR. |
Uh oh!
There was an error while loading. Please reload this page.