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
crashy interplay between value class, existentials, inference #7818
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7818?orig=1 |
@retronym said: def synchronize: Observable1[T] = new Observable1[T](foo(asJava)) |
@retronym said: In this case our expected type contains a new type parameter (of the extension method), whereas the type of the tree contains an existential skolem still pinned to the corresponding class type parameter.
|
@retronym said: |
Samuel Grütter (samuelgruetter) said:
The only workaround I found was a typecast. Is there a safer workaround? |
@retronym said: cat sandbox/test.scala
object Test {
class Observable[+T](val asJava: JObservable[_ <: T]) extends AnyVal {
private def foo[X](a: JObservable[X]): JObservable[X] = ???
def window(count: Int): Observable[Observable[T]] = {
convert(asJava.window()): Observable[Observable[T]]
}
}
class JObservable[T] {
def window(): JObservable[JObservable[T]] = ???
}
def convert[T](jObs: JObservable[JObservable[T]]): Observable[Observable[T]] = ???
}
topic/2894-rebase ~/code/scala scalac-hash v2.10.2 sandbox/test.scala
[info] v2.10.2 => /Users/jason/usr/scala-v2.10.2-0-g60d462e
topic/2894-rebase ~/code/scala |
Samuel Grütter (samuelgruetter) said: |
The text was updated successfully, but these errors were encountered: