KT-2096 Abstract property with no type specified causes compiler to crash

#KT-2096 fixed
This commit is contained in:
Svetlana Isakova
2012-05-25 14:04:32 +04:00
parent 8d3aeb9e1e
commit f03ce0795e
2 changed files with 14 additions and 1 deletions
@@ -211,7 +211,13 @@ public class DeclarationsChecker {
JetPropertyAccessor setter = property.getSetter();
boolean hasAccessorImplementation = (getter != null && getter.getBodyExpression() != null) ||
(setter != null && setter.getBodyExpression() != null);
if (propertyDescriptor.getModality() == Modality.ABSTRACT) return;
if (propertyDescriptor.getModality() == Modality.ABSTRACT) {
if (property.getInitializer() == null && property.getPropertyTypeRef() == null) {
trace.report(PROPERTY_WITH_NO_TYPE_NO_INITIALIZER.on(property));
}
return;
}
boolean inTrait = classDescriptor != null && classDescriptor.getKind() == ClassKind.TRAIT;
JetExpression initializer = property.getInitializer();
@@ -0,0 +1,7 @@
//KT-2096 Abstract property with no type specified causes compiler to crash
package c
abstract class Foo{
<!PROPERTY_WITH_NO_TYPE_NO_INITIALIZER!>protected abstract val prop<!>
}