summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/matching/CodeFactory.scala16
-rw-r--r--test/files/pos/t1260.scala (renamed from test/pending/pos/t1260.scala)0
2 files changed, 6 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/CodeFactory.scala b/src/compiler/scala/tools/nsc/matching/CodeFactory.scala
index 893506b742..8e034b1570 100644
--- a/src/compiler/scala/tools/nsc/matching/CodeFactory.scala
+++ b/src/compiler/scala/tools/nsc/matching/CodeFactory.scala
@@ -37,16 +37,12 @@ trait CodeFactory {
final def targetLabel(owner: Symbol, pos: Position, name:String, argtpes:List[Type], resultTpe: Type) =
owner.newLabel(pos, name).setInfo(new MethodType(argtpes, resultTpe))
- final def targetParams(subst:Binding):List[ValDef] = if(subst eq NoBinding) Nil else subst match {
- case Binding(v,t,n) => ValDef(v, {
- //v.setFlag(symtab.Flags.TRANS_FLAG);
- if(t.tpe <:< v.tpe) mkIdent(t)
- else if(v.tpe <:< t.tpe) typed{gen.mkAsInstanceOf(mkIdent(t),v.tpe)} // refinement
- else {
- cunit.error(v.pos, "internal error, types don't match: pattern variable "+v+":"+v.tpe+" temp "+t+":"+t.tpe)
- typed{gen.mkAsInstanceOf(mkIdent(t), v.tpe)} // refinement
- }
- })::targetParams(n)
+ /**
+ * Convert a pattern binding into a list of value definitions.
+ */
+ final def targetParams(subst:Binding):List[ValDef] = subst match {
+ case NoBinding => Nil;
+ case Binding(v,t,n) => ValDef(v, typed(mkIdent(t)))::targetParams(n)
}
/** returns `List[ Tuple2[ scala.Int, <elemType> ] ]' */
diff --git a/test/pending/pos/t1260.scala b/test/files/pos/t1260.scala
index b05259998e..b05259998e 100644
--- a/test/pending/pos/t1260.scala
+++ b/test/files/pos/t1260.scala