-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Drop requirement that self types are closed #16648
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Error: tests/neg/i16407.scala:2:2 ----------------------------------------------------------------------------------- | ||
2 | f(g()) // error // error | ||
| ^ | ||
| cannot resolve reference to type (X.this : Y & X).A | ||
| the classfile defining the type might be missing from the classpath | ||
| or the self type of (X.this : Y & X) might not contain all transitive dependencies | ||
-- Error: tests/neg/i16407.scala:2:4 ----------------------------------------------------------------------------------- | ||
2 | f(g()) // error // error | ||
| ^ | ||
| cannot resolve reference to type (X.this : Y & X).A | ||
| the classfile defining the type might be missing from the classpath | ||
| or the self type of (X.this : Y & X) might not contain all transitive dependencies |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
trait X { self: Y => | ||
f(g()) // error // error | ||
} | ||
trait Y { self: Z => | ||
type B = A | ||
def f(a: B): Unit = () | ||
def g(): A = ??? | ||
} | ||
trait Z { | ||
type A | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
trait X { //missing requirement: self type Z[?] & X of trait X does not conform to self type Z[X.this.A] of required trait Z | ||
self: Z[_] => | ||
} | ||
|
||
trait Z[A] extends X { | ||
self: Z[A] => // comment this to compile successfully | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
trait X { self: Y => } // error: missing requirement: self type Y & X of trait X does not conform to self type Z of required trait Y | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There is no error anymore. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True. But we do leave the old errors in anyway if a neg test gets moved to pos as a documentation what went wrong before. That's done for many other pos tests as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah OK. I did not know that. All good, then. |
||
trait Y { self: Z => } | ||
trait Z | ||
|
||
package squants: | ||
trait Quantity[A <: Quantity[A]] { self: A => } | ||
trait TimeDerivative[A <: Quantity[A]] { self: Quantity[_] => } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments in this
pos
file are not accurate. They say there's an error but clearly there isn't.