aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-04-30 11:45:01 +0200
committerMartin Odersky <odersky@gmail.com>2015-05-02 19:07:38 +0200
commit464ef81915cd428fc8918a2943ea4401ab0ef30a (patch)
tree9a76c5ab2a15e74f72e19bfe968e09da74699c49 /src
parent3df53946319d7f6c7af6e0eca757e548b6bc5cef (diff)
downloaddotty-464ef81915cd428fc8918a2943ea4401ab0ef30a.tar.gz
dotty-464ef81915cd428fc8918a2943ea4401ab0ef30a.tar.bz2
dotty-464ef81915cd428fc8918a2943ea4401ab0ef30a.zip
Remove worksround in ExpandSAMs
Removed the workaround of the original crasher which was addressed in the last commit.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/transform/ExpandSAMs.scala15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/dotty/tools/dotc/transform/ExpandSAMs.scala b/src/dotty/tools/dotc/transform/ExpandSAMs.scala
index 1340a2067..1f822a12c 100644
--- a/src/dotty/tools/dotc/transform/ExpandSAMs.scala
+++ b/src/dotty/tools/dotc/transform/ExpandSAMs.scala
@@ -41,21 +41,8 @@ class ExpandSAMs extends MiniPhaseTransform { thisTransformer =>
private def toPartialFunction(tree: Block)(implicit ctx: Context, info: TransformerInfo): Tree = {
val Block(
- (applyDef @ DefDef(nme.ANON_FUN, Nil, List(params), _, _)) :: Nil,
+ (applyDef @ DefDef(nme.ANON_FUN, Nil, List(List(param)), _, _)) :: Nil,
Closure(_, _, tpt)) = tree
- val List(param) = params
- // Dotty problem: If we match instead List(List(param)) directly,
- // we get:
- // Exception in thread "main" java.lang.AssertionError: assertion failed: self instantiation of (A?
- // ...
- // at scala.Predef$.assert(Predef.scala:165)
- // at dotty.tools.dotc.core.Types$TypeVar.instantiateWith(Types.scala:2308)
- // at dotty.tools.dotc.core.Types$TypeVar.instantiate(Types.scala:2363)
- // at dotty.tools.dotc.typer.Inferencing$$anonfun$interpolate$1$1$$anonfun$apply$mcV$sp$4.apply(Inferencing.scala:198)
- // at dotty.tools.dotc.typer.Inferencing$$anonfun$interpolate$1$1$$anonfun$apply$mcV$sp$4.apply(Inferencing.scala:195)
- //
- // I think it has to do with the double :: (or List) pattern to extract `param`.
-
val applyRhs: Tree = applyDef.rhs
val applyFn = applyDef.symbol.asTerm