Refactor CallableReferencesResolutionUtils.kt
Get rid of trace & reportOn parameters of createReflectionTypeForCallableDescriptor: move the two checks that required them to DoubleColonExpressionResolver and combine with other checks into a single function that checks the validity of the referenced symbol. This also makes these checks reported only once when invalid expressions are passed as function arguments (previously they were also reported from getResolvedCallableReferenceShapeType). Also inline getReflectionTypeForCandidateDescriptor after this, and refactor its usages
This commit is contained in:
Vendored
+6
-1
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
class A {
|
||||
fun Int.extInt() = 42
|
||||
fun A.extA(x: String) = x
|
||||
@@ -6,9 +6,14 @@ class A {
|
||||
fun main() {
|
||||
Int::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extInt<!>
|
||||
A::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extA<!>
|
||||
|
||||
eat(Int::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extInt<!>)
|
||||
eat(A::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extA<!>)
|
||||
}
|
||||
}
|
||||
|
||||
fun eat(value: Any) {}
|
||||
|
||||
fun main() {
|
||||
A::<!UNRESOLVED_REFERENCE!>extInt<!>
|
||||
A::<!UNRESOLVED_REFERENCE!>extA<!>
|
||||
|
||||
Reference in New Issue
Block a user