File tree Expand file tree Collapse file tree 2 files changed +31
-5
lines changed
src/compiler/scala/tools/nsc/transform Expand file tree Collapse file tree 2 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -685,11 +685,13 @@ abstract class UnCurry extends InfoTransform
685685 case Packed (param, tempVal) => (param, tempVal)
686686 }.unzip
687687
688- val rhs1 = localTyper.typedPos(rhs.pos) {
689- // Patch the method body to refer to the temp vals
690- val rhsSubstituted = rhs.substituteSymbols(packedParams map (_.symbol), tempVals map (_.symbol))
691- // The new method body: { val p$1 = p.asInstanceOf[<dependent type>]; ...; <rhsSubstituted> }
692- Block (tempVals, rhsSubstituted)
688+ val rhs1 = if (tempVals.isEmpty) rhs else {
689+ localTyper.typedPos(rhs.pos) {
690+ // Patch the method body to refer to the temp vals
691+ val rhsSubstituted = rhs.substituteSymbols(packedParams map (_.symbol), tempVals map (_.symbol))
692+ // The new method body: { val p$1 = p.asInstanceOf[<dependent type>]; ...; <rhsSubstituted> }
693+ Block (tempVals, rhsSubstituted)
694+ }
693695 }
694696
695697 (allParams :: Nil , rhs1)
Original file line number Diff line number Diff line change 1+
2+ class U {
3+ trait Transformer {
4+ def transform (a : Tree ): Tree = ???
5+ }
6+ trait Tree
7+ }
8+
9+ object Test {
10+ def m (u : U ) = {
11+ class C extends u.Transformer {
12+ override def transform (t : u.Tree ): u.Tree = {
13+ null match {
14+ case _ =>
15+ // crashes in GenICode:
16+ // error: Unknown type: <notype>, <notype> [class scala.reflect.internal.Types$NoType$, class scala.reflect.internal.Types$NoType$] TypeRef? false
17+ (y : Any ) => super .transform(??? )
18+ null
19+ }
20+ ???
21+ }
22+ }
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments