-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Incorrect warning “type test cannot be checked at runtime” #8932
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
Labels
Comments
This is actually correct, see the example below: sealed trait Foo[+A]
case class Bar[A]() extends Foo[A]
class Dummy extends Bar[Nothing] with Foo[String]
def bugReport[A](foo: Foo[A]): Foo[A] =
foo match {
case bar: Bar[A] => bar
}
def test = bugReport(new Dummy: Foo[String]) You need to mark |
liufengyun
added a commit
to dotty-staging/dotty
that referenced
this issue
May 10, 2020
Merged
Thank you Fengyun for the detailed explanation! |
julienrf
added a commit
to endpoints4s/endpoints4s
that referenced
this issue
May 10, 2020
julienrf
added a commit
to endpoints4s/endpoints4s
that referenced
this issue
May 12, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Minimized code
Output
Expectation
There should be no warning.
Additional information
A
is covariant inBar
The text was updated successfully, but these errors were encountered: