Skip to content
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

Union inference regression in 3.1.2 #15460

Closed
unthingable opened this issue Jun 16, 2022 · 3 comments · Fixed by #15478
Closed

Union inference regression in 3.1.2 #15460

unthingable opened this issue Jun 16, 2022 · 3 comments · Fixed by #15478
Labels
itype:bug regression This worked in a previous version but doesn't anymore
Milestone

Comments

@unthingable
Copy link

type C = Function0[Int] | Function0[String]

def foo(c: C): Unit = ()

foo(() => 1)

Output

3.1.1:
image
3.1.2:
image

@unthingable unthingable added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 16, 2022
@s5bug
Copy link

s5bug commented Jun 16, 2022

Additional note that foo( (() => 1): Function0[Int] ) (explicit ascription) compiles.

@nicolasstucki nicolasstucki added the regression This worked in a previous version but doesn't anymore label Jun 17, 2022
@odersky
Copy link
Contributor

odersky commented Jun 19, 2022

Can we find the commit that broke this?

@griggt
Copy link
Contributor

griggt commented Jun 19, 2022

First bad commit is 6ac8b47 from #14026

odersky added a commit to dotty-staging/dotty that referenced this issue Jun 19, 2022
Restore funtionality that was dropped in 6ac8b47

Fixes scala#15460
@odersky odersky removed the stat:needs triage Every issue needs to have an "area" and "itype" label label Jun 19, 2022
@Kordyjan Kordyjan added this to the 3.2.1 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants