KT-1934 Check inherited signatures for compatibility

Overridden signatures should have compatible return types
(equal types for 'var').
Only relevant overrides should be taken into account.
Refactor inherited signatures check,
introduce a strategy interface for problem reporting.
This commit is contained in:
Dmitry Petrov
2015-12-01 10:21:30 +03:00
parent 18e343d405
commit 135c30323b
19 changed files with 833 additions and 44 deletions
@@ -96,9 +96,13 @@ public class IdeErrorMessages {
MAP.put(RETURN_TYPE_MISMATCH_ON_OVERRIDE, "<html>Return type is ''{0}'', which is not a subtype of overridden<br/>" +
"{1}</html>", HTML_RENDER_RETURN_TYPE, DescriptorRenderer.HTML);
MAP.put(RETURN_TYPE_MISMATCH_ON_INHERITANCE, "<html>Return types of inherited members are incompatible:<br/>{0},<br/>{1}</html>",
DescriptorRenderer.HTML, DescriptorRenderer.HTML);
MAP.put(PROPERTY_TYPE_MISMATCH_ON_OVERRIDE, "<html>Var-property type is ''{0}'', which is not a type of overridden<br/>" +
"{1}</html>", HTML_RENDER_RETURN_TYPE, DescriptorRenderer.HTML);
MAP.put(PROPERTY_TYPE_MISMATCH_ON_INHERITANCE, "<html>Property types of inherited members are incompatible:<br/>{0},<br/>{1}</html>",
DescriptorRenderer.HTML, DescriptorRenderer.HTML);
MAP.put(VAR_OVERRIDDEN_BY_VAL, "<html>Val-property cannot override var-property<br />" +
"{1}</html>", DescriptorRenderer.HTML, DescriptorRenderer.HTML);