Skip to content

Dependent function loses information about singleton type #8128

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

Closed
OlivierBlanvillain opened this issue Jan 29, 2020 · 0 comments · Fixed by #8139
Closed

Dependent function loses information about singleton type #8128

OlivierBlanvillain opened this issue Jan 29, 2020 · 0 comments · Fixed by #8139

Comments

@OlivierBlanvillain
Copy link
Contributor

object Test {
  def id: (x: 1 | 0) => x.type = x => x
  id(0): 0
}
-- [E007] Type Mismatch Error: /test.scala:3:4 
3 |  id(0): 0
  |  ^^^^^
  |  Found:    (1 : Int) | (0 : Int)
  |  Required: (0 : Int)
1 error found
@OlivierBlanvillain OlivierBlanvillain changed the title Dependent function lose information about singleton type Dependent function loses information about singleton type Jan 29, 2020
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 13, 2020
@nicolasstucki nicolasstucki linked a pull request Feb 17, 2020 that will close this issue
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 29, 2020
smarter added a commit that referenced this issue Mar 1, 2020
robstoll pushed a commit to tegonal/dotty that referenced this issue Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant