use of org.jetbrains.kotlin.descriptors.VariableDescriptor in project kotlin by JetBrains.
the class CompileTimeConstantUtils method checkConstructorParametersType.
public static void checkConstructorParametersType(@NotNull List<KtParameter> parameters, @NotNull BindingTrace trace) {
for (KtParameter parameter : parameters) {
VariableDescriptor parameterDescriptor = trace.getBindingContext().get(VALUE_PARAMETER, parameter);
if (parameterDescriptor == null)
continue;
KotlinType parameterType = parameterDescriptor.getType();
KtTypeReference typeReference = parameter.getTypeReference();
if (typeReference != null) {
if (parameterType.isMarkedNullable()) {
trace.report(NULLABLE_TYPE_OF_ANNOTATION_MEMBER.on(typeReference));
} else if (!isAcceptableTypeForAnnotationParameter(parameterType)) {
trace.report(INVALID_TYPE_OF_ANNOTATION_MEMBER.on(typeReference));
}
}
}
}
Aggregations