aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/neg/t5543.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/neg/t5543.scala')
-rw-r--r--tests/untried/neg/t5543.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/untried/neg/t5543.scala b/tests/untried/neg/t5543.scala
new file mode 100644
index 000000000..4e03e6e11
--- /dev/null
+++ b/tests/untried/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() }
+}