Skip to content

failure to infer literal types from literal terms #3782

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
soronpo opened this issue Jan 9, 2018 · 0 comments
Closed

failure to infer literal types from literal terms #3782

soronpo opened this issue Jan 9, 2018 · 0 comments
Assignees

Comments

@soronpo
Copy link
Contributor

soronpo commented Jan 9, 2018

  class Foo[T](val value : T) {type Out = T} 
  object Foo {
    def fromXInt[T <: Int with Singleton](i : T): Foo[T] = new Foo[T](i)
  }
  val f1 = Foo.fromXInt(1)
8 |  val f1 = Foo.fromXInt(1)
  |               ^
  |        Type argument Int does not conform to upper bound Int & Singleton
@smarter smarter self-assigned this Jan 9, 2018
smarter added a commit to dotty-staging/dotty that referenced this issue Jan 9, 2018
The fix in ec53918 was incomplete: we
need to check if the upper bound is a subtype and not just a reference
to scala.Singleton
smarter added a commit that referenced this issue Jan 15, 2018
Fix #3782: Fix type parameter inference with scala.Singleton
nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Jan 16, 2018
allanrenucci added a commit that referenced this issue Jan 16, 2018
Revert "Fix #3782: Fix type parameter inference with scala.Singleton"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants