Skip to content

Commit 5b53ca4

Browse files
committed
Remove worksround in ExpandSAMs
Removed the workaround of the original crasher which was addressed in the last commit.
1 parent d2dcddf commit 5b53ca4

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

src/dotty/tools/dotc/transform/ExpandSAMs.scala

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,8 @@ class ExpandSAMs extends MiniPhaseTransform { thisTransformer =>
4141

4242
private def toPartialFunction(tree: Block)(implicit ctx: Context, info: TransformerInfo): Tree = {
4343
val Block(
44-
(applyDef @ DefDef(nme.ANON_FUN, Nil, List(params), _, _)) :: Nil,
44+
(applyDef @ DefDef(nme.ANON_FUN, Nil, List(List(param)), _, _)) :: Nil,
4545
Closure(_, _, tpt)) = tree
46-
val List(param) = params
47-
// Dotty problem: If we match instead List(List(param)) directly,
48-
// we get:
49-
// Exception in thread "main" java.lang.AssertionError: assertion failed: self instantiation of (A?
50-
// ...
51-
// at scala.Predef$.assert(Predef.scala:165)
52-
// at dotty.tools.dotc.core.Types$TypeVar.instantiateWith(Types.scala:2308)
53-
// at dotty.tools.dotc.core.Types$TypeVar.instantiate(Types.scala:2363)
54-
// at dotty.tools.dotc.typer.Inferencing$$anonfun$interpolate$1$1$$anonfun$apply$mcV$sp$4.apply(Inferencing.scala:198)
55-
// at dotty.tools.dotc.typer.Inferencing$$anonfun$interpolate$1$1$$anonfun$apply$mcV$sp$4.apply(Inferencing.scala:195)
56-
//
57-
// I think it has to do with the double :: (or List) pattern to extract `param`.
58-
5946
val applyRhs: Tree = applyDef.rhs
6047
val applyFn = applyDef.symbol.asTerm
6148

0 commit comments

Comments
 (0)