-
Notifications
You must be signed in to change notification settings - Fork 21
Narrowing of types is too shallow #7585
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
Imported From: https://issues.scala-lang.org/browse/SI-7585?orig=1 |
@gkossakowski said: |
@paulp said: trait Outer {
val x: Object
def alias: Outer { val x: Outer.this.x.type } = this
} |
@gkossakowski said: I was very surprised to discover that "this" doesn't to the that trivial refinement especially when the type ascription works. |
@paulp said: |
@paulp said: https://issues.scala-lang.org/secure/IssueNavigator.jspa?mode=hide&requestId=12210 |
I run into this problem when refactoring the cake:
This looks like should be trivially true but it fails to type check. According to Adriaan it fails because narrowing of types is to shallow and is not being applied to members.
This will be probably closed as Won't Fix but I filed it just for record.
The text was updated successfully, but these errors were encountered: