-
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.
Space: Revert how invariant targs are erased to fix regression
The motivating case (i16451) is complicated, because it involves unchecked type arguments. To fix the regression, I'm reverting the fix.
- Loading branch information
Showing
10 changed files
with
59 additions
and
15 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
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
File renamed without changes.
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,16 @@ | ||
type Untyped = Type | Null | ||
|
||
class Type | ||
abstract class SearchFailureType extends Type | ||
|
||
abstract class Tree[+T <: Untyped]: | ||
def tpe: T = null.asInstanceOf[T] | ||
|
||
class SearchFailureIdent[+T <: Untyped] extends Tree[T] | ||
|
||
class Test_i17230_bootstrap: | ||
def t1(arg: Tree[Type]) = arg match | ||
case arg: SearchFailureIdent[?] => arg.tpe match | ||
case x: SearchFailureType => | ||
case _ => | ||
case _ => |
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,15 @@ | ||
// scalac: -Werror | ||
trait Foo: | ||
type Bar[_] | ||
|
||
object Foo: | ||
type Aux[B[_]] = Foo { type Bar[A] = B[A] } | ||
|
||
class Test: | ||
def t1[B[_]](self: Option[Foo.Aux[B]]) = self match | ||
case Some(_) => 1 | ||
case None => 2 | ||
|
||
def t2[B[_]](self: Option[Foo.Aux[B]]) = self match | ||
case Some(f) => 1 | ||
case None => 2 |
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,20 @@ | ||
// scalac: -Werror | ||
import scala.util.* | ||
|
||
trait Transaction { | ||
type State[_] | ||
} | ||
object Transaction { | ||
type of[S[_]] = Transaction { type State[A] = S[A] } | ||
} | ||
trait DynamicScope[State[_]] | ||
|
||
case class ScopeSearch[State[_]](self: Either[Transaction.of[State], DynamicScope[State]]) { | ||
|
||
def embedTransaction[T](f: Transaction.of[State] => T): T = | ||
self match { | ||
case Left(integrated) => ??? | ||
case Right(ds) => ??? | ||
} | ||
} | ||
|