allow delegated properties to have getters and setters without bodies

This commit is contained in:
Dmitry Jemerov
2015-03-04 13:50:58 +01:00
committed by Andrey Breslav
parent 8ba15937f9
commit e9266481c5
7 changed files with 60 additions and 3 deletions
@@ -203,7 +203,7 @@ public class DefaultErrorMessages {
MAP.put(ABSTRACT_PROPERTY_WITH_SETTER, "Property with setter implementation cannot be abstract");
MAP.put(ABSTRACT_DELEGATED_PROPERTY, "Delegated property cannot be abstract");
MAP.put(ACCESSOR_FOR_DELEGATED_PROPERTY, "Delegated property cannot have accessor");
MAP.put(ACCESSOR_FOR_DELEGATED_PROPERTY, "Delegated property cannot have accessors with non-default implementations");
MAP.put(DELEGATED_PROPERTY_IN_TRAIT, "Delegated properties are not allowed in traits");
MAP.put(LOCAL_VARIABLE_WITH_DELEGATE, "Local variables are not allowed to have delegates");
@@ -514,12 +514,12 @@ public class BodyResolver {
@NotNull JetScope propertyScope
) {
JetPropertyAccessor getter = jetProperty.getGetter();
if (getter != null) {
if (getter != null && getter.hasBody()) {
trace.report(ACCESSOR_FOR_DELEGATED_PROPERTY.on(getter));
}
JetPropertyAccessor setter = jetProperty.getSetter();
if (setter != null) {
if (setter != null && setter.hasBody()) {
trace.report(ACCESSOR_FOR_DELEGATED_PROPERTY.on(setter));
}