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 a7e8cfa commit 1574490Copy full SHA for 1574490
tests/neg/binaryLiterals.scala
@@ -5,3 +5,4 @@ object Test:
5
val y = 0b1__0000_0000_0000_0000__0000_0000_0000_0000__0000_0000_0000_0000__0000_0000_0000_0000L // error: number too large
6
val Y = 0B1__0000_0000_0000_0000__0000_0000_0000_0000__0000_0000_0000_0000__0000_0000_0000_0000L // error: number too large
7
0b // error: invalid literal number
8
+ 0b2 // error: invalid literal number
tests/run/binaryLiterals.scala
@@ -1,5 +1,9 @@
1
@main
2
def Test =
3
+ val kenobi = 0b1
4
+
+ assert(kenobi == 1)
assert(0B0000 == 0)
assert(0B0001 == 1)
9
assert(0B0010 == 2)
0 commit comments