summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Iry <jamesiry@gmail.com>2013-02-07 16:48:13 -0800
committerJames Iry <jamesiry@gmail.com>2013-02-07 16:48:13 -0800
commitbbac0c06020db47dc46e3df7eb083b4f9f70a260 (patch)
tree54bec87fbdb3b7d6a0d1ac2e7e9593a35d7c35e8
parent427e1864aec01b3b23ddc133c2090eec5c201be0 (diff)
parenta53e1508660f849e86e34808e5d4230b078f7a3e (diff)
downloadscala-bbac0c06020db47dc46e3df7eb083b4f9f70a260.tar.gz
scala-bbac0c06020db47dc46e3df7eb083b4f9f70a260.tar.bz2
scala-bbac0c06020db47dc46e3df7eb083b4f9f70a260.zip
Merge pull request #2089 from VladUreche/issue/7100
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]
+ }
+}