From 5a6a7631576f8be6aa268717b2df821a3f9c9426 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Sat, 1 Jul 2006 16:43:55 +0000 Subject: transmatch creates proper context for typer, an... transmatch creates proper context for typer, and returns emptytree in case of failure --- src/compiler/scala/tools/nsc/matching/TransMatcher.scala | 13 ++++++++----- 1 file 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); -- cgit v1.2.3