Inject non-context dependent CallCheckers instead of getting them from context

This commit is contained in:
Pavel V. Talanov
2015-07-22 18:59:17 +03:00
parent 2885da8993
commit 3227ae5577
25 changed files with 69 additions and 94 deletions
@@ -42,7 +42,7 @@ import org.jetbrains.kotlin.types.TypeUtils
import java.lang.annotation.Target
public class JavaAnnotationCallChecker : CallChecker {
override fun <F : CallableDescriptor?> check(resolvedCall: ResolvedCall<F>, context: BasicCallResolutionContext) {
override fun <F : CallableDescriptor> check(resolvedCall: ResolvedCall<F>, context: BasicCallResolutionContext) {
val resultingDescriptor = resolvedCall.getResultingDescriptor().getOriginal()
if (resultingDescriptor !is JavaConstructorDescriptor ||
resultingDescriptor.getContainingDeclaration().getKind() != ClassKind.ANNOTATION_CLASS) return
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
public class JavaAnnotationMethodCallChecker : CallChecker {
override fun <F : CallableDescriptor?> check(resolvedCall: ResolvedCall<F>, context: BasicCallResolutionContext) {
override fun <F : CallableDescriptor> check(resolvedCall: ResolvedCall<F>, context: BasicCallResolutionContext) {
val descriptor = resolvedCall.getCandidateDescriptor().getOriginal()
val containingDeclaration = descriptor.getContainingDeclaration()