summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2013-02-07 23:33:07 +0100
committerVlad Ureche <vlad.ureche@gmail.com>2013-02-07 23:36:13 +0100
commita53e1508660f849e86e34808e5d4230b078f7a3e (patch)
treece396a8c9d8fc2eabfecc60f3b8f7ac78240d02f
parent33608ffb282e3b844b28143d9f3588e57c20c7aa (diff)
downloadscala-a53e1508660f849e86e34808e5d4230b078f7a3e.tar.gz
scala-a53e1508660f849e86e34808e5d4230b078f7a3e.tar.bz2
scala-a53e1508660f849e86e34808e5d4230b078f7a3e.zip
SI-7100 Fixed infinite recursion in duplicators
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Duplicators.scala2
-rw-r--r--test/files/pos/SI-7100.scala6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
index 0b46582cbf..f6142a81be 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -388,7 +388,7 @@ abstract class Duplicators extends Analyzer {
cases
}
- super.typedPos(tree.pos, mode, pt)(Match(scrut, cases1))
+ super.typed(atPos(tree.pos)(Match(scrut, cases1)), mode, pt)
case EmptyTree =>
// no need to do anything, in particular, don't set the type to null, EmptyTree.tpe_= asserts
diff --git a/test/files/pos/SI-7100.scala b/test/files/pos/SI-7100.scala
new file mode 100644
index 0000000000..7cb6356ec8
--- /dev/null
+++ b/test/files/pos/SI-7100.scala
@@ -0,0 +1,6 @@
+class Buffer {
+ def f[@specialized(Int) T](): T = 0 match {
+ case 0 => 0.asInstanceOf[T]
+ case 1 => 0.asInstanceOf[T]
+ }
+}