KT-2096 Abstract property with no type specified causes compiler to crash
#KT-2096 fixed
This commit is contained in:
@@ -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<!>
|
||||
}
|
||||
Reference in New Issue
Block a user