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
too eager widening of singleton types #102
Comments
Imported From: https://issues.scala-lang.org/browse/SI-102?orig=1 |
@odersky said: |
@adriaanm said: case class buildProd[TFoo <: Foo](foo: TFoo) { // now it works
def apply(a: foo.Arg): foo.Prod = foo.makeProd(a)
} |
@odersky said: buildProd[myFoo.tpe](myFoo) ? |
@adriaanm said:
buildProd[myFoo.tpe](myFoo)
buildProd[java.lang.Object with Foo{type Arg = Int; type Prod = (Int, Int)}](main.this.myFoo).apply(1) |
@odersky said: |
@soc said: scala> buildProd(myFoo)(1)
<console>:12: error: type mismatch;
found : Int(1)
required: _4.foo.Arg where val _4: buildProd
buildProd(myFoo)(1)
^ |
@paulp said: |
I expected the following code to compile:
Instead, the compiler complains:
It seems foo.type gets approximated to Foo too early..
The text was updated successfully, but these errors were encountered: