summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2006-07-01 16:43:55 +0000
committerBurak Emir <emir@epfl.ch>2006-07-01 16:43:55 +0000
commit5a6a7631576f8be6aa268717b2df821a3f9c9426 (patch)
tree7ba9829508a2bdbb150737a55237369db87274fa
parentfc172924547bf8cbd0b36f1f40677ccd183edd71 (diff)
downloadscala-5a6a7631576f8be6aa268717b2df821a3f9c9426.tar.gz
scala-5a6a7631576f8be6aa268717b2df821a3f9c9426.tar.bz2
scala-5a6a7631576f8be6aa268717b2df821a3f9c9426.zip
transmatch creates proper context for typer, an...
transmatch creates proper context for typer, and returns emptytree in case of failure
-rw-r--r--src/compiler/scala/tools/nsc/matching/TransMatcher.scala13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
index 6a2347ea95..470855b978 100644
--- a/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
+++ b/src/compiler/scala/tools/nsc/matching/TransMatcher.scala
@@ -306,7 +306,8 @@ with RightTracers {
System.out.println("" + sel + " match " + ocases);
cunit.error(sel.pos, "regular expressions not yet implemented");
- sel
+ //sel
+ EmptyTree
} else {
val pm = new PatternMatcher();
pm.initialize(sel, currentOwner, true );
@@ -356,10 +357,12 @@ with RightTracers {
//Console.println("TransMatcher currentOwner ="+currentOwner+")");
//Console.println("TransMatcher selector.tpe ="+selector.tpe+")");
//Console.println("TransMatcher resultType ="+resultType+")");
- val t_untyped = handle(nselector, ncases.asInstanceOf[List[CaseDef]]);
- //Console.println("t_untyped "+t_untyped.toString());
- val t = typed { atPos(tree.pos) (t_untyped) };
- //Console.println("t typed "+t.toString());
+ val t_untyped = handle(nselector, ncases.asInstanceOf[List[CaseDef]])
+ //Console.println("t_untyped "+t_untyped.toString())
+ val t = atPos(tree.pos) { typer.atOwner(tree,currentOwner).typed(t_untyped, resultType) }
+ //val t = atPos(tree.pos) { typed(t_untyped, resultType) }
+ //val t = atPos(tree.pos) { typed(t_untyped) }
+ //Console.println("t typed "+t.toString())
t
case _ =>
super.transform(tree);