Check if returned typeParameters are null

- See EA-141456, EA-212070
This commit is contained in:
Roman Golyshev
2020-03-24 15:12:38 +03:00
committed by Roman Golyshev
parent 4171dd511f
commit 85bfbaa8a8
2 changed files with 12 additions and 2 deletions
@@ -287,7 +287,12 @@ public abstract class FunctionDescriptorImpl extends DeclarationDescriptorNonRoo
@Override
@NotNull
public List<TypeParameterDescriptor> getTypeParameters() {
return typeParameters;
List<TypeParameterDescriptor> parameters = typeParameters;
// Diagnostics for EA-141456
if (parameters == null) {
throw new IllegalStateException("typeParameters == null for " + this);
}
return parameters;
}
@Override
@@ -152,7 +152,12 @@ public class PropertyDescriptorImpl extends VariableDescriptorWithInitializerImp
@NotNull
@Override
public List<TypeParameterDescriptor> getTypeParameters() {
return typeParameters;
List<TypeParameterDescriptor> parameters = typeParameters;
// Diagnostics for EA-212070
if (parameters == null) {
throw new IllegalStateException("typeParameters == null for " + this.toString());
}
return parameters;
}
@Override