Files
kotlin-fork/compiler/testData/diagnostics/tests/numbers/intValuesOutOfRange.kt
T
Svetlana Isakova 96db2ecabd added different errors instead of ERROR_COMPILE_TIME_VALUE with different text
check type for constants in DataFlowUtils
2013-09-13 16:04:17 +04:00

17 lines
592 B
Kotlin

package a
fun foo(i: Int) = i
fun bar(l: Long) = l
fun main(args: Array<String>) {
val <!UNUSED_VARIABLE!>i<!> = <!INT_LITERAL_OUT_OF_RANGE!>111111111111111777777777777777<!>
//todo add diagnostic text messages
//report only 'The value is out of range'
//not 'An integer literal does not conform to the expected type Int/Long'
val <!UNUSED_VARIABLE!>l<!>: Long = <!INT_LITERAL_OUT_OF_RANGE!>1111111111111117777777777777777<!>
foo(<!INT_LITERAL_OUT_OF_RANGE!>11111111111111177777777777777<!>)
bar(<!INT_LITERAL_OUT_OF_RANGE!>11111111111111177777777777777<!>)
}