Use hasInitializer() instead of getInitializer() in DescriptorResolver
This commit is contained in:
@@ -986,8 +986,7 @@ public class DescriptorResolver {
|
|||||||
|
|
||||||
boolean hasDelegate = variable instanceof JetProperty && ((JetProperty) variable).hasDelegateExpression();
|
boolean hasDelegate = variable instanceof JetProperty && ((JetProperty) variable).hasDelegateExpression();
|
||||||
if (propertyTypeRef == null) {
|
if (propertyTypeRef == null) {
|
||||||
final JetExpression initializer = variable.getInitializer();
|
if (!variable.hasInitializer()) {
|
||||||
if (initializer == null) {
|
|
||||||
if (hasDelegate && variableDescriptor instanceof PropertyDescriptor) {
|
if (hasDelegate && variableDescriptor instanceof PropertyDescriptor) {
|
||||||
final JetProperty property = (JetProperty) variable;
|
final JetProperty property = (JetProperty) variable;
|
||||||
final JetExpression propertyDelegateExpression = property.getDelegateExpression();
|
final JetExpression propertyDelegateExpression = property.getDelegateExpression();
|
||||||
@@ -1017,7 +1016,7 @@ public class DescriptorResolver {
|
|||||||
new Function0<JetType>() {
|
new Function0<JetType>() {
|
||||||
@Override
|
@Override
|
||||||
public JetType invoke() {
|
public JetType invoke() {
|
||||||
JetType initializerType = resolveInitializerType(scope, initializer, dataFlowInfo, trace);
|
JetType initializerType = resolveInitializerType(scope, variable.getInitializer(), dataFlowInfo, trace);
|
||||||
setConstantForVariableIfNeeded(variableDescriptor, scope, variable, dataFlowInfo, initializerType, trace);
|
setConstantForVariableIfNeeded(variableDescriptor, scope, variable, dataFlowInfo, initializerType, trace);
|
||||||
return transformAnonymousTypeIfNeeded(variableDescriptor, variable, initializerType, trace);
|
return transformAnonymousTypeIfNeeded(variableDescriptor, variable, initializerType, trace);
|
||||||
}
|
}
|
||||||
@@ -1025,7 +1024,7 @@ public class DescriptorResolver {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
JetType initializerType = resolveInitializerType(scope, initializer, dataFlowInfo, trace);
|
JetType initializerType = resolveInitializerType(scope, variable.getInitializer(), dataFlowInfo, trace);
|
||||||
setConstantForVariableIfNeeded(variableDescriptor, scope, variable, dataFlowInfo, initializerType, trace);
|
setConstantForVariableIfNeeded(variableDescriptor, scope, variable, dataFlowInfo, initializerType, trace);
|
||||||
return initializerType;
|
return initializerType;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user