summaryrefslogtreecommitdiff
path: root/test/files/neg/t5543.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/neg/t5543.scala')
-rw-r--r--test/files/neg/t5543.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/t5543.scala b/test/files/neg/t5543.scala
new file mode 100644
index 0000000000..4e03e6e114
--- /dev/null
+++ b/test/files/neg/t5543.scala
@@ -0,0 +1,19 @@
+class C1 {
+ type T
+ def this(x: T) { this() }
+}
+
+class C1a[T] {
+ def this(x: T) { this() } // works, no error here
+}
+
+class C2(x: Int) {
+ def this(a: Int, b: Int = x) {
+ this(b)
+ }
+}
+
+class C3 {
+ val x = 0
+ def this(a: Int = x) { this() }
+}