-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathend.test.scala
48 lines (41 loc) · 922 Bytes
/
end.test.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/// SYNTAX TEST "source.scala"
// From: https://dotty.epfl.ch/docs/reference/other-new-features/indentation.html
package p1.p2:
abstract class C() with
def this(x: Int) =
this()
if x > 0 then
val a :: b =
x :: Nil
end val
var y =
x
end y
while y > 0 do
println(y)
y -= 1
end while
try
x match
case 0 => println("0")
case _ =>
end match
finally
println("done")
end try
end if
end this
def f: String
end C
object C with
given C =
new C:
def f = "!"
end f
end new
end given
end C
extension (x: C)
def ff: String = x.f ++ x.f
end extension
end p2