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 @@ -878,11 +878,13 @@ abstract class UnCurry extends InfoTransform
878878 case Packed (param, tempVal) => (param, tempVal)
879879 }.unzip
880880
881- val rhs1 = localTyper.typedPos(rhs.pos) {
882- // Patch the method body to refer to the temp vals
883- val rhsSubstituted = rhs.substituteSymbols(packedParams map (_.symbol), tempVals map (_.symbol))
884- // The new method body: { val p$1 = p.asInstanceOf[<dependent type>]; ...; <rhsSubstituted> }
885- Block (tempVals, rhsSubstituted)
881+ val rhs1 = if (tempVals.isEmpty) rhs else {
882+ localTyper.typedPos(rhs.pos) {
883+ // Patch the method body to refer to the temp vals
884+ val rhsSubstituted = rhs.substituteSymbols(packedParams map (_.symbol), tempVals map (_.symbol))
885+ // The new method body: { val p$1 = p.asInstanceOf[<dependent type>]; ...; <rhsSubstituted> }
886+ Block (tempVals, rhsSubstituted)
887+ }
886888 }
887889
888890 (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