diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java index 29592beb7c3..aba3fac6caf 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DeclarationsChecker.java @@ -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(); diff --git a/compiler/testData/diagnostics/tests/declarationChecks/kt2096.jet b/compiler/testData/diagnostics/tests/declarationChecks/kt2096.jet new file mode 100644 index 00000000000..f51c275607f --- /dev/null +++ b/compiler/testData/diagnostics/tests/declarationChecks/kt2096.jet @@ -0,0 +1,7 @@ +//KT-2096 Abstract property with no type specified causes compiler to crash + +package c + +abstract class Foo{ + protected abstract val prop +} \ No newline at end of file