Fix message text for INCOMPATIBLE_ENUM_COMPARISON

^KT-28516 Fixed
This commit is contained in:
Denis Zharkov
2018-11-29 18:00:22 +03:00
parent a534bfc32f
commit 2182be82e6
6 changed files with 33 additions and 2 deletions
@@ -731,7 +731,7 @@ public class DefaultErrorMessages {
return nameExpression.getReferencedName();
}, RENDER_TYPE, RENDER_TYPE);
MAP.put(INCOMPATIBLE_ENUM_COMPARISON, "Comparison of incompatible enums ''{1}'' and ''{2}'' is always unsuccessful", RENDER_TYPE, RENDER_TYPE);
MAP.put(INCOMPATIBLE_ENUM_COMPARISON, "Comparison of incompatible enums ''{0}'' and ''{1}'' is always unsuccessful", RENDER_TYPE, RENDER_TYPE);
MAP.put(SENSELESS_COMPARISON, "Condition ''{0}'' is always ''{1}''", ELEMENT_TEXT, TO_STRING);
MAP.put(SENSELESS_NULL_IN_WHEN, "Expression under 'when' is never equal to null");
@@ -685,7 +685,7 @@ class PatternMatchingTypingVisitor internal constructor(facade: ExpressionTyping
}
if (TypeIntersector.isIncompatibleEnums(type, subjectType)) {
context.trace.report(INCOMPATIBLE_ENUM_COMPARISON.on(reportErrorOn, type, subjectType))
context.trace.report(INCOMPATIBLE_ENUM_COMPARISON.on(reportErrorOn, subjectType, type))
}
// check if the pattern is essentially a 'null' expression