From aeda72b2ea265c7960e8055f526d1bef93940c04 Mon Sep 17 00:00:00 2001 From: Aleksandar Pokopec Date: Mon, 26 Sep 2011 12:44:24 +0000 Subject: 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. --- test/files/pos/t4351.check | 1 + test/files/pos/t4351.scala | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/files/pos/t4351.check create mode 100644 test/files/pos/t4351.scala (limited to 'test/files/pos') 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 -- cgit v1.2.3