Skip to content

Opaque type with generic forgets its boundaries #8152

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
rcano opened this issue Jan 31, 2020 · 0 comments
Closed

Opaque type with generic forgets its boundaries #8152

rcano opened this issue Jan 31, 2020 · 0 comments

Comments

@rcano
Copy link

rcano commented Jan 31, 2020

minimized code

object opaque {
  opaque type Foo[X] <: String = String
}
object test {
  val s: String = ???.asInstanceOf[opaque.Foo[_]]
}

Compilation output

Found:    guarana.swing.opaque.Foo[?]
Required: String(7)

expectation

It should compile. Note that this does compile

object opaque {
  opaque type Foo <: String = String
}
object test {
  val s: String = ???.asInstanceOf[opaque.Foo]
}
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 4, 2020
@odersky odersky closed this as completed in c7e9404 Feb 5, 2020
odersky added a commit that referenced this issue Feb 5, 2020
Fix #8152: Rearchitect some parts of opaque types handling
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

1 participant