File tree 2 files changed +12
-18
lines changed
2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 1
1
object Test
2
2
3
- locally :
3
+ locally {
4
4
var x = 0
5
5
while x < 10 do x += 1
6
6
end while // error: end of statement expected but while found // error: not found: end
@@ -9,7 +9,8 @@ object Test
9
9
x += 1
10
10
x < 10
11
11
do ()
12
- end while // error: misaligned end marker
12
+ end while // error: misaligned end marker // error: not found : end
13
+ } // error: ';' expected, but '}' found
13
14
14
15
def f (x : Int ): Int =
15
16
val y =
@@ -23,22 +24,12 @@ object Test
23
24
24
25
val z = 22
25
26
x + y + z
26
- end f // error: misaligned end marker
27
+ end f
27
28
28
29
def g = " !"
29
30
30
31
val xs = List (1 , 2 , 3 )
31
32
32
- xs.map:
33
- x =>
34
- val y = x * x
35
- y * y
36
-
37
- xs.map:
38
- x =>
39
- val y = x * x
40
- y + y
41
-
42
33
println(f(2 ) + g)
43
34
44
35
(new Test2 ).foo
@@ -57,10 +48,11 @@ class Test2
57
48
def foo = 1
58
49
59
50
object x
60
- new Test2 :
51
+ new Test2 {
61
52
override def foo = 2
62
53
end new // error: end of statement expected but new found // error: not found: end
63
- def bar = 2 // error: ';' expected, but unindent found
54
+ } // error: ';' expected, but '}' found
55
+ def bar = 2
64
56
end Test2 // error: misaligned end marker
65
57
end Test2
66
58
@@ -102,9 +94,11 @@ class Coder(words: List[String])
102
94
/** Invert the mnemonics map to give a map from chars 'A' ... 'Z' to '2' ... '9' */
103
95
private val charCode0 : Map [Char , Char ] =
104
96
mnemonics
105
- .withFilter:
97
+ .withFilter {
106
98
case (digit, str) => true
107
99
case _ => false
108
- .flatMap:
100
+ }
101
+ .flatMap {
109
102
case (digit, str) => str map (ltr => ltr -> digit)
103
+ }
110
104
end Coder // error: The start of this line does not match any of the previous indentation widths.
Original file line number Diff line number Diff line change 1
1
// ==> 05bef7805687ba94da37177f7568e3ba7da1f91c.scala <==
2
2
class x0 {
3
3
x1 : // error
4
- x0 | _
4
+ x0 | _ // error
5
5
// error
You can’t perform that action at this time.
0 commit comments