You should always use L
if you are using a long. Otherwise, you can still have problems:
scala> val x: Long = 10000000000
<console>:1: error: integer number too large
val x: Long = 10000000000
^
scala> val x = 10000000000L
x: Long = 10000000000
The conversion due to type ascription happens after the literal has been interpreted as Int
.