Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1981 from retronym/backport/1187
[backport] SI-3577 BoundedWildcardType handling
- Loading branch information
Showing
4 changed files
with
42 additions
and
7 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,29 @@ | ||
case class Check[A](val value: A) | ||
|
||
case class C2(checks: Check[_]*); | ||
|
||
object C { | ||
def m(x : C2): Any = (null: Any) match { | ||
case C2(_, rest @ _*) => { | ||
rest.map(_.value) | ||
} | ||
} | ||
} | ||
|
||
/////////////////// | ||
|
||
object Container { | ||
trait Exp[+T] | ||
abstract class FuncExp[-S, +T] | ||
|
||
sealed abstract class FoundNode[T, Repr] { | ||
def optimize[TupleT, U, That](parentNode: FlatMap[T, Repr, U, That]): Any | ||
def optimize2[TupleT, U, That](parentNode: Any): Any | ||
} | ||
|
||
class FlatMap[T, Repr, U, That] | ||
|
||
val Seq(fn: FoundNode[t, repr]) = Seq[FoundNode[_, _]]() | ||
fn.optimize(null) // was: scala.MatchError: ? (of class BoundedWildcardType) @ Variances#varianceInType | ||
fn.optimize2(null) // was: fatal error: bad type: ?(class scala.reflect.internal.Types$BoundedWildcardType) @ Pickle.putType | ||
} |