[ANALYSIS API] introduce dedicated KtCall for incomplete code
KTIJ-23505 and duplicates
This commit is contained in:
@@ -145,6 +145,25 @@ public class KtGenericTypeQualifier(
|
||||
public val qualifier: KtExpression get() = withValidityAssertion { _qualifier }
|
||||
}
|
||||
|
||||
/**
|
||||
* A special call for type qualifiers with generic parameters which represent [KtCallExpression] in incomplete code.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```
|
||||
* fun test() {
|
||||
* List<String>
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
public class KtQualifierCall(
|
||||
override val token: KtLifetimeToken,
|
||||
private val _qualifier: KtCallExpression,
|
||||
) : KtCall() {
|
||||
|
||||
public val qualifier: KtCallExpression get() = withValidityAssertion { _qualifier }
|
||||
}
|
||||
|
||||
/**
|
||||
* A callable symbol partially applied with receivers and type arguments. Essentially, this is a call that misses some information. For
|
||||
* properties, the missing information is the type of access (read, write, or compound access) to this property. For functions, the missing
|
||||
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
open class Server() {
|
||||
companion object {
|
||||
val NAME = "Server"
|
||||
}
|
||||
}
|
||||
|
||||
class Client: Server() {
|
||||
val name = <expr>Server</expr>.NAME
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
null
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = ALE<kotlin.String>
|
||||
symbol = <constructor>(): ALE<T>
|
||||
valueParameters = []
|
||||
callableIdIfNonLocal = null
|
||||
typeArgumentsMapping = {}
|
||||
argumentMapping = {}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class ALE<T> {}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val ale = <expr>ALE<String></expr>
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = [
|
||||
KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = ALE<T>
|
||||
symbol = <constructor>(): ALE<T>
|
||||
valueParameters = []
|
||||
callableIdIfNonLocal = null
|
||||
typeArgumentsMapping = {
|
||||
T -> (kotlin.String)
|
||||
}
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<null: Inapplicable candidate>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtGenericTypeQualifier:
|
||||
qualifier = Foo<String>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class Foo<T>(len : Int) {
|
||||
constructor(s : String) : this(s.length) {}
|
||||
}
|
||||
|
||||
fun f() {
|
||||
<expr>Foo<String></expr>
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = [
|
||||
KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Foo<T>
|
||||
symbol = <constructor>(len: kotlin.Int): Foo<T>
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = len
|
||||
receiverType = null
|
||||
returnType = kotlin.Int
|
||||
symbol = len: kotlin.Int
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = null
|
||||
typeArgumentsMapping = {
|
||||
T -> (kotlin.String)
|
||||
}
|
||||
argumentMapping = {},
|
||||
KtSimpleFunctionCall:
|
||||
isImplicitInvoke = false
|
||||
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||
dispatchReceiver = null
|
||||
extensionReceiver = null
|
||||
signature = KtFunctionLikeSignature:
|
||||
receiverType = null
|
||||
returnType = Foo<T>
|
||||
symbol = <constructor>(s: kotlin.String): Foo<T>
|
||||
valueParameters = [
|
||||
KtVariableLikeSignature:
|
||||
name = s
|
||||
receiverType = null
|
||||
returnType = kotlin.String
|
||||
symbol = s: kotlin.String
|
||||
callableIdIfNonLocal = null
|
||||
]
|
||||
callableIdIfNonLocal = null
|
||||
typeArgumentsMapping = {
|
||||
T -> (kotlin.String)
|
||||
}
|
||||
argumentMapping = {}
|
||||
]
|
||||
diagnostic = ERROR<null: Inapplicable candidate>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
KtSuccessCallInfo:
|
||||
call = KtGenericTypeQualifier:
|
||||
qualifier = List<String>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
fun main(args: Array<Any>) {
|
||||
<expr>List<String></expr> s = new ArrayList<String>()
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = [
|
||||
KtQualifierCall:
|
||||
qualifier = List<String>
|
||||
]
|
||||
diagnostic = ERROR<null: Inapplicable candidate>
|
||||
Reference in New Issue
Block a user