summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2006-12-05 16:51:54 +0000
committerMartin Odersky <odersky@gmail.com>2006-12-05 16:51:54 +0000
commit0988bfd2e373fdcc6ad81e7eff9afa73227e3bc9 (patch)
treec3c64623037b799883dbe84a9114f4442f68c1be /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent67dfced37f9b5d7a2b7f80f4da7fb5716f557350 (diff)
downloadscala-0988bfd2e373fdcc6ad81e7eff9afa73227e3bc9.tar.gz
scala-0988bfd2e373fdcc6ad81e7eff9afa73227e3bc9.tar.bz2
scala-0988bfd2e373fdcc6ad81e7eff9afa73227e3bc9.zip
fixed bug 846.
added debug output to unapply problem.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index c9db05b064..73adb07d23 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1427,8 +1427,11 @@ trait Typers requires Analyzer {
val funPt = appliedType(OptionClass.typeConstructor, List(prod))
val fun0 = Ident(fun.symbol) setPos fun.pos setType otpe // would this change when patterns are terms???
- val fun1 = typed(atPos(fun.pos) { Apply(Select(
- gen.mkAttributedRef(fun.tpe.prefix,fun.symbol), unapp), List(arg)) }, EXPRmode, funPt)
+ val fun1untyped = atPos(fun.pos) {
+ Apply(Select(gen.mkAttributedRef(fun.tpe.prefix,fun.symbol), unapp), List(arg))
+ }
+ Console.println("UNAPP "+fun1untyped)
+ val fun1 = typed(fun1untyped, EXPRmode, funPt)
if (fun1.tpe.isErroneous) setError(tree)
else {
val formals0 = if(unapp.name == nme.unapply) optionOfProductElems(fun1.tpe)
@@ -2224,6 +2227,7 @@ trait Typers requires Analyzer {
//Console.println("typing "+tree+", "+context.undetparams);//DEBUG
val tree1 = if (tree.tpe ne null) tree else typed1(tree, mode, pt)
//Console.println("typed "+tree1+":"+tree1.tpe+", "+context.undetparams);//DEBUG
+
val result = if (tree1.isEmpty) tree1 else adapt(tree1, mode, pt)
//Console.println("adapted "+tree1+":"+tree1.tpe+" to "+pt+", "+context.undetparams);//DEBUG
result