Add resolution status to report about unsuccessful smartcast

#KT-10248 Fixed
 #KT-11119 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-06-19 13:22:45 +03:00
parent 0f4497256b
commit cd1ae7f0f2
12 changed files with 178 additions and 10 deletions
@@ -559,7 +559,7 @@ class CandidateResolver(
}
if (!smartCastResult.isCorrect) {
// Error about unstable smart cast reported within checkAndRecordPossibleCast
return OTHER_ERROR
return UNSTABLE_SMARTCAST_ERROR
}
}
}
@@ -24,6 +24,7 @@ public enum ResolutionStatus {
UNKNOWN_STATUS,
UNSAFE_CALL_ERROR,
WRONG_NUMBER_OF_TYPE_ARGUMENTS_ERROR,
UNSTABLE_SMARTCAST_ERROR,
OTHER_ERROR,
ARGUMENTS_MAPPING_ERROR,
// '1.foo()' shouldn't be resolved to 'fun String.foo()'
@@ -40,6 +41,7 @@ public enum ResolutionStatus {
public static final EnumSet<ResolutionStatus>[] SEVERITY_LEVELS = new EnumSet[] {
EnumSet.of(UNSAFE_CALL_ERROR), // weakest
EnumSet.of(WRONG_NUMBER_OF_TYPE_ARGUMENTS_ERROR),
EnumSet.of(UNSTABLE_SMARTCAST_ERROR),
EnumSet.of(OTHER_ERROR),
EnumSet.of(ARGUMENTS_MAPPING_ERROR),
EnumSet.of(RECEIVER_TYPE_ERROR),