lightAnnotations: check element validity before resolving call

This commit is contained in:
Nicolay Mitropolsky
2018-07-13 15:26:49 +03:00
parent cedc6821c3
commit 3c71761cf3
2 changed files with 2 additions and 0 deletions
@@ -341,6 +341,7 @@ private val backendNullabilityAnnotations = arrayOf(Nullable::class.java.name, N
private fun KtElement.analyze(): BindingContext = LightClassGenerationSupport.getInstance(this.project).analyze(this)
private fun KtElement.getResolvedCall(): ResolvedCall<out CallableDescriptor>? {
if (!isValid) return null
val context = analyze()
return this.getResolvedCall(context)
}
@@ -343,6 +343,7 @@ private val backendNullabilityAnnotations = arrayOf(Nullable::class.java.name, N
private fun KtElement.analyze(): BindingContext = LightClassGenerationSupport.getInstance(this.project).analyze(this)
private fun KtElement.getResolvedCall(): ResolvedCall<out CallableDescriptor>? {
if (!isValid) return null
val context = analyze()
return this.getResolvedCall(context)
}