-
Notifications
You must be signed in to change notification settings - Fork 21
False shadowing deprecation warning from #8353 #11895
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
Comments
This was referenced Feb 24, 2020
Thanks for testing the snapshot! |
I'll spend a few minutes this evening, as I'm also interested in #8121 false warning. |
Are type members allowed to shadow nested classes in parents? That seems like cheating. |
This is some weird stuff. scala> trait A { type Foo; def foo: Foo }
trait A
scala> class B extends A { class Foo(); val foo = new Foo() }
class B
scala> class C extends B { type Foo = String; override val foo: this.Foo = "foo" }
^
error: incompatible type in overriding
val foo: C.this.Foo (defined in class B);
found : C.this.java.lang.Foo
(which expands to) String
required: C.this.Foo(in class B)
scala> class C extends B { type Foo = String; override val foo: super.Foo = new super.Foo() }
^
error: incompatible type in overriding
def foo: C.this.Foo (defined in trait A);
found : C.this.Foo(in class B)
required: C.this.java.lang.Foo
(which expands to) String
scala> class C extends B { type Foo = String; override val foo: super.Foo with this.Foo = null }
class C Also, lol @ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code emits a class shadowing deprecation warning where none exists (AFAIK).
This code compiles in dotty 0.22.0-RC1 without any warnings.
The text was updated successfully, but these errors were encountered: