Skip to content

Commit eb7e94a

Browse files
committed
Add test
1 parent 25fa24e commit eb7e94a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/neg/creator-applys2.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
object Test2 {
3+
class A(s: String = "A") {
4+
def run = s
5+
}
6+
object A {
7+
def apply() = A("X") // error: recursive method needs return type
8+
}
9+
}
10+
11+
object Test3 {
12+
class A(s: String = "A") {
13+
def run = s
14+
}
15+
object A {
16+
def apply(): A = A("X") // error too many arguments
17+
}
18+
}

0 commit comments

Comments
 (0)