Fix project compilation
First parameters of `DiagnosticFactory.on` methods are annotated as 'NotNull'
This commit is contained in:
+1
-1
@@ -108,7 +108,7 @@ class JavaNullabilityWarningsChecker : AdditionalTypeChecker {
|
||||
if (WhenChecker.getEnumMissingCases(expression, context, enumClassDescriptor).isEmpty()
|
||||
&& !WhenChecker.containsNullCase(expression, context)) {
|
||||
|
||||
c.trace.report(ErrorsJvm.WHEN_ENUM_CAN_BE_NULL_IN_JAVA.on(expression.getSubjectExpression()))
|
||||
c.trace.report(ErrorsJvm.WHEN_ENUM_CAN_BE_NULL_IN_JAVA.on(expression.subjectExpression!!))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ class TraitDefaultMethodCallChecker : CallChecker {
|
||||
if (classifier != null && DescriptorUtils.isInterface(classifier)) {
|
||||
context.trace.report(
|
||||
ErrorsJvm.INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER.on(
|
||||
PsiTreeUtil.getParentOfType(resolvedCall.getCall().getCallElement(), KtExpression::class.java)
|
||||
PsiTreeUtil.getParentOfType(resolvedCall.call.callElement, KtExpression::class.java)!!
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -102,7 +102,7 @@ class DeclarationResolver(
|
||||
val reportAt =
|
||||
if (declarationOrPackageDirective is KtPackageDirective) declarationOrPackageDirective.getNameIdentifier()
|
||||
else declarationOrPackageDirective
|
||||
trace.report(Errors.REDECLARATION.on(reportAt, fqName.shortName().asString()))
|
||||
trace.report(Errors.REDECLARATION.on(reportAt!!, fqName.shortName().asString()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ class TypeResolver(
|
||||
|
||||
val arguments = resolveTypeProjections(c, ErrorUtils.createErrorType("No type").constructor, type.typeArguments)
|
||||
if (!arguments.isEmpty()) {
|
||||
c.trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(type.getTypeArgumentList(), 0))
|
||||
c.trace.report(WRONG_NUMBER_OF_TYPE_ARGUMENTS.on(type.typeArgumentList!!, 0))
|
||||
}
|
||||
|
||||
val containing = typeParameter.containingDeclaration
|
||||
@@ -552,10 +552,10 @@ class TypeResolver(
|
||||
val parameterDescriptor = constructor.parameters[i]
|
||||
if (kind != INVARIANT && parameterDescriptor.variance != INVARIANT) {
|
||||
if (kind == parameterDescriptor.variance) {
|
||||
c.trace.report(REDUNDANT_PROJECTION.on(argumentElement, constructor.getDeclarationDescriptor()))
|
||||
c.trace.report(REDUNDANT_PROJECTION.on(argumentElement, constructor.declarationDescriptor!!))
|
||||
}
|
||||
else {
|
||||
c.trace.report(CONFLICTING_PROJECTION.on(argumentElement, constructor.getDeclarationDescriptor()))
|
||||
c.trace.report(CONFLICTING_PROJECTION.on(argumentElement, constructor.declarationDescriptor!!))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ class TracingStrategyForImplicitConstructorDelegationCall(
|
||||
}
|
||||
|
||||
override fun unresolvedReference(trace: BindingTrace) {
|
||||
trace.report(UNRESOLVED_REFERENCE.on(calleeExpression, calleeExpression))
|
||||
trace.report(UNRESOLVED_REFERENCE.on(calleeExpression!!, calleeExpression))
|
||||
}
|
||||
|
||||
override fun <D : CallableDescriptor> unresolvedReferenceWrongReceiver(trace: BindingTrace, candidates: Collection<ResolvedCall<D>>) {
|
||||
|
||||
+1
-2
@@ -107,8 +107,7 @@ open class LazyClassMemberScope(
|
||||
}
|
||||
|
||||
override fun conflict(fromSuper: CallableMemberDescriptor, fromCurrent: CallableMemberDescriptor) {
|
||||
val declaration = DescriptorToSourceUtils.descriptorToDeclaration(fromCurrent) as KtDeclaration?
|
||||
assert(declaration != null) { "fromCurrent can not be a fake override" }
|
||||
val declaration = DescriptorToSourceUtils.descriptorToDeclaration(fromCurrent) as? KtDeclaration ?: error("fromCurrent can not be a fake override")
|
||||
trace.report(Errors.CONFLICTING_OVERLOADS.on(declaration, fromCurrent, fromCurrent.getContainingDeclaration().getName().asString()))
|
||||
}
|
||||
})
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
|
||||
}
|
||||
|
||||
if (function.getName() != null) {
|
||||
context.trace.report(ANONYMOUS_FUNCTION_WITH_NAME.on(function.getNameIdentifier()))
|
||||
context.trace.report(ANONYMOUS_FUNCTION_WITH_NAME.on(function.nameIdentifier!!))
|
||||
}
|
||||
|
||||
for (parameter in function.getValueParameters()) {
|
||||
|
||||
@@ -79,7 +79,7 @@ internal abstract class AbstractNativeIndexerChecker(
|
||||
if (firstParamClassDescriptor != builtIns.string &&
|
||||
!DescriptorUtils.isSubclass(firstParamClassDescriptor, builtIns.number)
|
||||
) {
|
||||
diagnosticHolder.report(ErrorsJs.NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER.on(declaration.valueParameters.firstOrNull(), indexerKind))
|
||||
diagnosticHolder.report(ErrorsJs.NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER.on(declaration.valueParameters.first(), indexerKind))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user