-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject all explicitly written type references with bad bounds
... except for type parameters, since these will need to be instantiated with good types themselves. Fixes further unsoundness examples added to neg/i15569.scala.
- Loading branch information
Showing
11 changed files
with
43 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
trait Expr { type T } | ||
|
||
def foo[A](e: Expr { type T = A }) = e match | ||
case e1: Expr { type T <: Int } => | ||
val i: Int = ??? : e1.T // error: unrealizable bounds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-- Error: tests/neg/i15568.scala:3:15 ---------------------------------------------------------------------------------- | ||
3 |type Bar = Foo[? >: Int <: String] // error | ||
| ^ | ||
| type argument has potentially unrealizable bounds >: Int <: String | ||
| type has potentially conflicting bounds >: Int <: String |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class B { | ||
val a: String = (((1: Any): b.A): Nothing): String // error | ||
val b: { type A >: Any <: Nothing } = loop() | ||
def loop(): Nothing = loop() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
trait Expr { type T } | ||
|
||
def foo[A](e: Expr { type T = A }) = e match | ||
def foo[A <: Int](e: Expr { type T = A }) = e match | ||
case e1: Expr { type T <: Int } => | ||
val i: Int = ??? : e1.T | ||
val i: Int = ??? : e1.T |