Skip to content

Commit 5f18dca

Browse files
committed
Add test file.
1 parent 6982c67 commit 5f18dca

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/run/defaultGetters.scala

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
object Test {
2+
3+
def foo[T](x: T = "abc") = x
4+
def bam(x: => Unit = ()) = x
5+
def bar(x: => Unit = { println("default bar"); () }) = x
6+
def baz(x: => String = { println("default baz"); "cde" }) = x
7+
8+
def main(args: Array[String]): Unit = {
9+
assert(foo() == "abc")
10+
bam()
11+
bar()
12+
baz()
13+
}
14+
}

0 commit comments

Comments
 (0)