Uast: Uast produces reified methods on his own because light-classes doesn't (KT-34316)
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
package test.pkg
|
||||
|
||||
class Context {
|
||||
inline fun <reified T> ownSystemService1() = getSystemService(T::class.java)
|
||||
inline fun ownSystemService2() = getSystemService(String::class.java)
|
||||
}
|
||||
|
||||
|
||||
inline fun <reified T> Context.systemService1() = getSystemService(T::class.java)
|
||||
inline fun Context.systemService2() = getSystemService(String::class.java)
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
UFile (package = test.pkg)
|
||||
UClass (name = ReifiedKt)
|
||||
UMethod (name = systemService2)
|
||||
UParameter (name = $this$systemService2)
|
||||
UAnnotation (fqName = org.jetbrains.annotations.NotNull)
|
||||
UBlockExpression
|
||||
UReturnExpression
|
||||
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
|
||||
UIdentifier (Identifier (getSystemService))
|
||||
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
|
||||
UQualifiedReferenceExpression
|
||||
UClassLiteralExpression
|
||||
USimpleNameReferenceExpression (identifier = java)
|
||||
UMethod (name = systemService1)
|
||||
UBlockExpression
|
||||
UReturnExpression
|
||||
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
|
||||
UIdentifier (Identifier (getSystemService))
|
||||
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
|
||||
UQualifiedReferenceExpression
|
||||
UClassLiteralExpression
|
||||
USimpleNameReferenceExpression (identifier = java)
|
||||
UClass (name = Context)
|
||||
UMethod (name = ownSystemService2)
|
||||
UBlockExpression
|
||||
UReturnExpression
|
||||
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
|
||||
UIdentifier (Identifier (getSystemService))
|
||||
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
|
||||
UQualifiedReferenceExpression
|
||||
UClassLiteralExpression
|
||||
USimpleNameReferenceExpression (identifier = java)
|
||||
UMethod (name = Context)
|
||||
UMethod (name = ownSystemService1)
|
||||
UBlockExpression
|
||||
UReturnExpression
|
||||
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
|
||||
UIdentifier (Identifier (getSystemService))
|
||||
USimpleNameReferenceExpression (identifier = <anonymous class>, resolvesTo = null)
|
||||
UQualifiedReferenceExpression
|
||||
UClassLiteralExpression
|
||||
USimpleNameReferenceExpression (identifier = java)
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package test.pkg
|
||||
|
||||
public final class ReifiedKt {
|
||||
public static final fun systemService2(@org.jetbrains.annotations.NotNull $this$systemService2: test.pkg.Context) : error.NonExistentClass {
|
||||
return <anonymous class>(java.lang.String.java)
|
||||
}
|
||||
fun systemService1() {
|
||||
return <anonymous class>(java.lang.Object.java)
|
||||
}
|
||||
}
|
||||
|
||||
public final class Context {
|
||||
public final fun ownSystemService2() : error.NonExistentClass {
|
||||
return <anonymous class>(java.lang.String.java)
|
||||
}
|
||||
public fun Context() = UastEmptyExpression
|
||||
fun ownSystemService1() {
|
||||
return <anonymous class>(java.lang.Object.java)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user