added different errors instead of ERROR_COMPILE_TIME_VALUE with different text

check type for constants in DataFlowUtils
This commit is contained in:
Svetlana Isakova
2013-09-12 17:25:59 +04:00
parent d556ceedc1
commit 96db2ecabd
30 changed files with 258 additions and 158 deletions
@@ -5,12 +5,12 @@ fun foo(i: Int) = i
fun bar(l: Long) = l
fun main(args: Array<String>) {
val <!UNUSED_VARIABLE!>i<!> = <!ERROR_COMPILE_TIME_VALUE!>111111111111111777777777777777<!>
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 = <!ERROR_COMPILE_TIME_VALUE!>1111111111111117777777777777777<!>
foo(<!ERROR_COMPILE_TIME_VALUE!>11111111111111177777777777777<!>)
bar(<!ERROR_COMPILE_TIME_VALUE!>11111111111111177777777777777<!>)
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<!>)
}
@@ -26,9 +26,9 @@ fun test() {
val <!UNUSED_VARIABLE!>g<!>: Byte = <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>either<!>(1, 300)
other(<!ERROR_COMPILE_TIME_VALUE!>11<!>)
other(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>11<!>)
<!TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH!>otherGeneric<!>(<!ERROR_COMPILE_TIME_VALUE!>1<!>)
<!TYPE_INFERENCE_TYPE_CONSTRUCTOR_MISMATCH!>otherGeneric<!>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>)
val r = either(1, "")
<!TYPE_MISMATCH!>r<!>: Int