Minor: better assertions and warnings removed
This commit is contained in:
committed by
Andrey Breslav
parent
1c81102941
commit
e4382ff95b
@@ -59,6 +59,8 @@ public class ControlFlowAnalyzer {
|
|||||||
JetType expectedReturnType = !function.hasBlockBody() && !function.hasDeclaredReturnType()
|
JetType expectedReturnType = !function.hasBlockBody() && !function.hasDeclaredReturnType()
|
||||||
? NO_EXPECTED_TYPE
|
? NO_EXPECTED_TYPE
|
||||||
: functionDescriptor.getReturnType();
|
: functionDescriptor.getReturnType();
|
||||||
|
assert expectedReturnType != null
|
||||||
|
: "functionDescriptor is not yet fully initialized or broken so return type is null " + functionDescriptor;
|
||||||
checkFunction(function, expectedReturnType);
|
checkFunction(function, expectedReturnType);
|
||||||
}
|
}
|
||||||
for (Map.Entry<JetProperty, PropertyDescriptor> entry : bodiesResolveContext.getProperties().entrySet()) {
|
for (Map.Entry<JetProperty, PropertyDescriptor> entry : bodiesResolveContext.getProperties().entrySet()) {
|
||||||
@@ -85,12 +87,14 @@ public class ControlFlowAnalyzer {
|
|||||||
PropertyAccessorDescriptor accessorDescriptor = accessor.isGetter()
|
PropertyAccessorDescriptor accessorDescriptor = accessor.isGetter()
|
||||||
? propertyDescriptor.getGetter()
|
? propertyDescriptor.getGetter()
|
||||||
: propertyDescriptor.getSetter();
|
: propertyDescriptor.getSetter();
|
||||||
assert accessorDescriptor != null;
|
assert accessorDescriptor != null : "no property accessor descriptor " + accessor.getText();
|
||||||
checkFunction(accessor, accessorDescriptor.getReturnType());
|
JetType returnType = accessorDescriptor.getReturnType();
|
||||||
|
assert returnType != null : "property accessor has no return type " + accessorDescriptor;
|
||||||
|
checkFunction(accessor, returnType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkFunction(JetDeclarationWithBody function, @NotNull JetType expectedReturnType) {
|
private void checkFunction(@NotNull JetDeclarationWithBody function, @NotNull JetType expectedReturnType) {
|
||||||
JetExpression bodyExpression = function.getBodyExpression();
|
JetExpression bodyExpression = function.getBodyExpression();
|
||||||
if (bodyExpression == null) return;
|
if (bodyExpression == null) return;
|
||||||
JetFlowInformationProvider flowInformationProvider = new JetFlowInformationProvider(function, trace);
|
JetFlowInformationProvider flowInformationProvider = new JetFlowInformationProvider(function, trace);
|
||||||
|
|||||||
Reference in New Issue
Block a user