summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-09-26 12:44:24 +0000
committerAleksandar Pokopec <aleksandar.prokopec@epfl.ch>2011-09-26 12:44:24 +0000
commitaeda72b2ea265c7960e8055f526d1bef93940c04 (patch)
treea545420871a718bf307555b39440841ccd219440 /test/files/pos
parent567e9f2980999b8c3c0931f44e0b6ae10331a0d9 (diff)
downloadscala-aeda72b2ea265c7960e8055f526d1bef93940c04.tar.gz
scala-aeda72b2ea265c7960e8055f526d1bef93940c04.tar.bz2
scala-aeda72b2ea265c7960e8055f526d1bef93940c04.zip
Fixes #4351.
Added an "Abstract" method info to the specialized phase, which denotes that no implementation should be generated. Previously: trait A[@specialized(Boolean) T] { def foo: T } used to generate: trait A$mcZ$sp extends A[Boolean] { def foo$mcZ$sp = this.foo } which caused cyclic calls because of linearization rules when several traits are mixed together. Now, the following is generated: trait A$mcZ$sp extends A[Boolean] { def foo$mcZ$sp: Boolean } Review by dragos.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/t4351.check1
-rw-r--r--test/files/pos/t4351.scala20
2 files changed, 21 insertions, 0 deletions
diff --git a/test/files/pos/t4351.check b/test/files/pos/t4351.check
new file mode 100644
index 0000000000..cb5d407e13
--- /dev/null
+++ b/test/files/pos/t4351.check
@@ -0,0 +1 @@
+runtime exception
diff --git a/test/files/pos/t4351.scala b/test/files/pos/t4351.scala
new file mode 100644
index 0000000000..2d57588793
--- /dev/null
+++ b/test/files/pos/t4351.scala
@@ -0,0 +1,20 @@
+object Test {
+ def main(args: Array[String]): Unit = {
+ try new BooleanPropImpl() value
+ catch {
+ case e: RuntimeException => println("runtime exception")
+ }
+ }
+}
+
+trait Prop[@specialized(Boolean) +T] {
+ def value: T
+}
+
+class PropImpl[+T] extends Prop[T] {
+ def value: T = scala.sys.error("")
+}
+
+trait BooleanProp extends Prop[Boolean]
+
+class BooleanPropImpl() extends PropImpl[Boolean] with BooleanProp