report only 'The value is out of range'

not 'An integer literal does not conform to the expected type Int/Long'
This commit is contained in:
Svetlana Isakova
2013-07-23 15:28:25 +04:00
parent f2746b835e
commit 0849798af0
3 changed files with 24 additions and 4 deletions
@@ -78,11 +78,10 @@ public class CompileTimeConstantResolver {
@NotNull
public CompileTimeConstant<?> getIntegerValue(@Nullable Long value, @NotNull JetType expectedType) {
if (value == null) {
return OUT_OF_RANGE;
}
if (noExpectedType(expectedType)) {
if (value == null) {
return OUT_OF_RANGE;
}
if (Integer.MIN_VALUE <= value && value <= Integer.MAX_VALUE) {
return new IntValue(value.intValue());
}