summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2007-08-22 08:53:58 +0000
committerBurak Emir <emir@epfl.ch>2007-08-22 08:53:58 +0000
commit5c301870f6cad0e87d7e38b048c8c4c482ceb360 (patch)
treed696d4e3d125440e18cd60d79242f70086f22332 /src/compiler
parentff9592bd515127e55167708441b6631b8c9b3bf5 (diff)
downloadscala-5c301870f6cad0e87d7e38b048c8c4c482ceb360.tar.gz
scala-5c301870f6cad0e87d7e38b048c8c4c482ceb360.tar.bz2
scala-5c301870f6cad0e87d7e38b048c8c4c482ceb360.zip
type attribute of Ident was lost, due to missin...
type attribute of Ident was lost, due to missing '.duplicate' (?!)
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/matching/ParallelMatching.scala7
-rw-r--r--src/compiler/scala/tools/nsc/matching/PatternMatchers.scala4
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala3
3 files changed, 6 insertions, 8 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
index 08bdfba340..92673f2835 100644
--- a/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
+++ b/src/compiler/scala/tools/nsc/matching/ParallelMatching.scala
@@ -435,7 +435,7 @@ trait ParallelMatching {
case ua @ UnApply(app @ Apply(fn, appargs), args) =>
val ures = newVarCapture(ua.pos, app.tpe)
val n = args.length
- val uacall = ValDef(ures, Apply(fn, mkIdent(scrutinee) :: appargs.tail))
+ val uacall = typedValDef(ures, Apply(fn, mkIdent(scrutinee) :: appargs.tail))
//Console.println("uacall:"+uacall)
val nrowsOther = column.tail.zip(rest.row.tail) flatMap { case (pat, Row(ps, subst, g, bx)) => strip2(pat) match {
@@ -524,9 +524,9 @@ trait ParallelMatching {
val treeAsSeq =
if(!isSubType(scrutinee.tpe, column.head.tpe))
- typed(gen.mkAsInstanceOf(gen.mkAttributedRef(scrutinee), column.head.tpe, true))
+ typed(gen.mkAsInstanceOf(mkIdent(scrutinee), column.head.tpe, true))
else
- gen.mkAttributedRef(scrutinee)
+ mkIdent(scrutinee)
val failRep = repWithoutHead(column,rest)
@@ -596,6 +596,7 @@ trait ParallelMatching {
case TypeRef(_,_,List(SingleType(pre,sym))) =>
gen.mkAttributedRef(pre,sym)
}
+ assert(vlue.tpe ne null)
val nsuccFst = rest.row.head match { case Row(pats,bnd,g,b) => Row(EmptyTree::pats,bnd,g,b) }
val nsuccRow = nsuccFst :: (column.tail.zip(rest.row.tail) map { case (p, Row(pats,bnd,g,b)) => Row(p::pats,bnd,g,b) })
val nsucc = rep.make(scrutinee :: rest.temp, nsuccRow)
diff --git a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala
index aa540586ef..7880070f6e 100644
--- a/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala
+++ b/src/compiler/scala/tools/nsc/matching/PatternMatchers.scala
@@ -1153,7 +1153,7 @@ print()
if(isSubType(selector.tpe, argtpe))
Literal(Constant(true))
else {
- useSelector = gen.mkAsInstanceOf(selector, argtpe)
+ useSelector = gen.mkAsInstanceOf(selector.duplicate, argtpe)
gen.mkIsInstanceOf(selector.duplicate, argtpe)
}
}
@@ -1170,7 +1170,7 @@ print()
if(isSubType(selector.tpe, argtpe))
Literal(Constant(true))
else {
- useSelector = gen.mkAsInstanceOf(selector, argtpe)
+ useSelector = gen.mkAsInstanceOf(selector.duplicate, argtpe)
gen.mkIsInstanceOf(selector.duplicate, argtpe)
}
}
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 81ee95d45b..5efd37cf68 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -781,9 +781,6 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
if (fn.symbol == Any_asInstanceOf || fn.symbol == Any_asInstanceOfErased)
fn match {
case TypeApply(Select(qual, _), List(targ)) =>
- //bq: if (qual.tpe eq null), it was surely an Ident constructed with Ident(sym)
- //if((qual eq null) || (targ eq null) || (qual.tpe eq null) || (targ.tpe eq null))
- // Console.println("qual: "+qual+" targ "+targ+" qual.tpe"+{if(qual eq null) "n.a. " else qual.tpe}+(if(qual.tpe eq null) "((but qual.symbol.tpe is "+qual.symbol.tpe+"))" else "")+ " targ.tpe "+{if(targ eq null) "n.a." else targ.tpe}+" Erasure: "+nodeToString(tree)) // DEBUG
if (qual.tpe <:< targ.tpe) {
atPos(tree.pos) { Typed(qual, TypeTree(targ.tpe)) }
} else if (isNumericValueClass(qual.tpe.typeSymbol) &&