summaryrefslogtreecommitdiff
path: root/test/files/pos/t10093.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@gmail.com>2016-12-06 12:48:30 +0100
committerLukas Rytz <lukas.rytz@gmail.com>2016-12-06 12:48:30 +0100
commit34dad77513d08535adaf26989bd0cd84993ceab1 (patch)
tree5fb4e31c2ca9f9d2c5c7f4eb365d6381c0367f3f /test/files/pos/t10093.scala
parentee1c02b374a4b8a053e9a8b14af5e205afa67e14 (diff)
downloadscala-34dad77513d08535adaf26989bd0cd84993ceab1.tar.gz
scala-34dad77513d08535adaf26989bd0cd84993ceab1.tar.bz2
scala-34dad77513d08535adaf26989bd0cd84993ceab1.zip
SI-10093 don't move member traits to constructor body in constructors
Fixes a regression introduced in c8e6050. Member traits with only abstract definitions (`isInterface`) were moved into the primary constructor by mistake. (Flatten moved the classes back.) The member trait was duplicated into the constructor of specialized subclasses, causing it to be generated multiple times. Also removes some unnecessary `isMixinConstructor` checks: the mixin constructor is always the primary constructor. This commit also clarifies (and tests) what `isInterface` means: for scala-defined traits, it means there are only abstract members. For java-defined interfaces, it is always true.
Diffstat (limited to 'test/files/pos/t10093.scala')
-rw-r--r--test/files/pos/t10093.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/pos/t10093.scala b/test/files/pos/t10093.scala
new file mode 100644
index 0000000000..a894a54926
--- /dev/null
+++ b/test/files/pos/t10093.scala
@@ -0,0 +1,5 @@
+class A[@specialized(Int) T](val value: T) {
+ trait B
+ def useValue(x:T): Unit = ()
+ useValue(value)
+}