Skip to content

Commit 4d9c0c5

Browse files
committed
Add more tests
1 parent 8ee0ec5 commit 4d9c0c5

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

tests/neg/3559b.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Error: tests/neg/3559b.scala:3:9 ------------------------------------------------------------------------------------
2+
3 | this(b) // error
3+
| ^
4+
| b is not accessible from constructor arguments

tests/neg/3559b.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class A(a: Any) {
2+
def this() = {
3+
this(b) // error
4+
}
5+
6+
def b = new {}
7+
}

tests/neg/3559c.check

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Error: tests/neg/3559c.scala:3:9 ------------------------------------------------------------------------------------
2+
3 | this(a) // error
3+
| ^
4+
| a is not accessible from constructor arguments

tests/neg/3559c.scala

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class A(a: Any) {
2+
def this() = {
3+
this(a) // error
4+
}
5+
6+
def b = new {}
7+
}

0 commit comments

Comments
 (0)