return type can be omitted when override

This commit is contained in:
Svetlana Isakova
2012-04-03 16:24:13 +04:00
parent 495287ea22
commit c47e3957a7
2 changed files with 5 additions and 1 deletions
@@ -162,7 +162,7 @@ public class DeclarationsChecker {
JetFunction function = (JetFunction) member;
hasDeferredType = function.getReturnTypeRef() == null && function.getBodyExpression() != null && !function.hasBlockBody();
}
if ((memberDescriptor.getVisibility().isPublicAPI()) && hasDeferredType) {
if ((memberDescriptor.getVisibility().isPublicAPI()) && memberDescriptor.getOverriddenDescriptors().size() == 0 && hasDeferredType) {
trace.report(PUBLIC_MEMBER_SHOULD_SPECIFY_TYPE.on(member));
}
}
@@ -38,3 +38,7 @@ class Q {
}
}
//check that 'toString' can be invoked without specifying 'public' and ': String'
class NewClass : java.util.ArrayList<Integer>() {
override fun toString() = "a"
}