-
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.
Delay widening in derivedSelect when avoiding
Using the example from `pos/i16435.avoid`: class Foo: type Value def test: Option[Value] = val scr = { val self: Foo.this.type = this None: Option[self.Value] } scr We want avoidance to return `Option[Value]`, aka `Option[Foo.this.Value]`, rather than widening to `Option[Any]`. But also, widen when we're deriving to an intersection prefix... Test cases: i16105,i16435,i2945,i8900,i8861. And fix some kind of race condition in creating files/directories.
- Loading branch information
Showing
5 changed files
with
28 additions
and
5 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 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,8 @@ | ||
class Foo: | ||
type Value | ||
def test: Option[Value] = | ||
val scr = { | ||
val self: Foo.this.type = this | ||
None: Option[self.Value] | ||
} | ||
scr |
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,11 @@ | ||
// scalac: -Werror | ||
trait Base: | ||
type Value | ||
inline def oov: Option[Option[Value]] = None | ||
def get: Option[Value] | ||
|
||
trait X extends Base: | ||
override def get: Option[Value] = | ||
oov match // was: match may not be exhaustive | ||
case Some(ov) => ov | ||
case None => None |