Skip to content

Commit a37cef8

Browse files
committed
Unleash old literals test with compromises
1 parent e54a934 commit a37cef8

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

tests/neg/literals.scala

+14-20
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,52 @@
1-
trait RejectedLiterals {
2-
def missingHex: Int = { 0x } // error: invalid literal number
3-
}
4-
/*
5-
// nsc: -Ywarn-octal-literal -Xfatal-warnings -deprecation
61
trait RejectedLiterals {
72

8-
def missingHex: Int = { 0x } // line 4: was: not reported, taken as zero
3+
def missingHex: Int = { 0x } // error: invalid literal number
94

105
def leadingZeros: Int = { 01 } // line 6: no leading zero
116

127
def tooManyZeros: Int = { 00 } // line 8: no leading zero
138

149
def zeroOfNine: Int = { 09 } // line 10: no leading zero
1510

16-
def orphanDot: Int = { 9. } // line 12: ident expected
11+
def orphanDot: Int = { 9. } // error: ident expected
1712

18-
def zeroOfNineDot: Int = { 09. } // line 14: malformed integer, ident expected
13+
def zeroOfNineDot: Int = { 09. } // error: malformed integer, ident expected
1914

20-
def noHexFloat: Double = { 0x1.2 } // line 16: ';' expected but double literal found.
15+
def noHexFloat: Double = { 0x1.2 } // error: ';' expected but double literal found.
2116

2217
}
2318

2419
trait Braceless {
2520

26-
def missingHex: Int = 0x // line 22: was: not reported, taken as zero
21+
def missingHex: Int = 0x // error: was: not reported, taken as zero
2722

2823
def leadingZeros: Int = 01 // line 24: no leading zero
2924

3025
def tooManyZeros: Int = 00 // line 26: no leading zero
3126

3227
def zeroOfNine: Int = 09 // line 28: no leading zero
3328

34-
def orphanDot: Int = 9. // line 30: ident expected
29+
def orphanDot: Int = 9. // should be: ident expected
3530

36-
def zeroOfNineDot: Int = 09. // line 32: malformed integer, ident expected
31+
def zeroOfNineDot: Int = 09. // error: an identifier expected, but 'def' found, shoule be ident expected
3732

38-
def noHexFloat: Double = 0x1.2 // line 34: ';' expected but double literal found.
33+
def noHexFloat: Double = 0x1.2 // should be: ';' expected but double literal found.
3934
}
4035

4136
trait MoreSadness {
4237

43-
def tooTiny: Float = { 0.7e-45f } // floating point number too small
38+
def tooTiny: Float = { 0.7e-45f } // error: floating point number too small
4439

45-
def twoTiny: Double = { 2.0e-324 } // double precision floating point number too small
40+
def twoTiny: Double = { 2.0e-324 } // error: double precision floating point number too small
4641

47-
def tooHuge: Float = { 3.4028236E38f } // floating point number too large
42+
def tooHuge: Float = { 3.4028236E38f } // error: floating point number too large
4843

49-
def twoHuge: Double = { 1.7976931348623159e308 } // double precision floating point number too large
50-
}
44+
def twoHuge: Double = { 1.7976931348623159e308 } // error: double precision floating point number too large
45+
} // error: Found: Unit etc, sad
5146

5247
trait Lengthy {
5348

5449
def bad = 1l
5550

5651
def worse = 123l
57-
}
58-
*/
52+
} // error: Found: Unit etc, sad // anypos-error: '}' expected, but eof found, sad

0 commit comments

Comments
 (0)