We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f6a5f4 commit 7b0d7d9Copy full SHA for 7b0d7d9
tests/run/i1503.check
@@ -0,0 +1,5 @@
1
+hello
2
+hi
3
+33
4
5
tests/run/i1503.scala
@@ -0,0 +1,38 @@
+object Test {
+
+ def test1() =
+ (new Function0[Unit] {
+ def apply() = println("hello")
6
+ })()
7
8
+ val cond = true
9
+ val foo = () => println("hi")
10
+ val bar = () => println("there")
11
12
+ val baz = (x: Int) => println(x)
13
14
+ def test2() =
15
+ (if (cond) foo else bar)()
16
17
+ def test2a() =
18
+ (if (cond) baz else baz)(33)
19
20
+ def test3() =
21
+ (try foo
22
+ catch { case ex: Exception => bar }
23
+ finally ())()
24
25
+ def test4() =
26
+ (cond match {
27
+ case true => foo
28
+ case false => bar
29
30
31
+ def main(args: Array[String]) = {
32
+ test1()
33
+ test2()
34
+ test2a()
35
+ test3()
36
+ test4()
37
+ }
38
+}
0 commit comments