Uast: making AbstractKotlinUClass not inherit from AbstractJavaUClass

This commit is contained in:
Nicolay Mitropolsky
2017-12-04 17:58:45 +03:00
committed by Nikolay Krasko
parent 084da3665a
commit e22e466485
8 changed files with 119 additions and 19 deletions
+22
View File
@@ -0,0 +1,22 @@
@Test
class A
annotation class MyAnnotation(val text: String)
@MyAnnotation("class")
class B {
@MyAnnotation("inB class")
class InB {
}
@MyAnnotation("companion")
companion object {
}
}
@MyAnnotation("object")
object Obj
+30
View File
@@ -0,0 +1,30 @@
UFile (package = )
UClass (name = A)
UAnnotation (fqName = null)
UAnnotationMethod (name = A)
UClass (name = MyAnnotation)
UAnnotationMethod (name = text)
UClass (name = B)
UAnnotation (fqName = MyAnnotation)
UNamedExpression (name = text)
ULiteralExpression (value = "class")
UField (name = Companion)
UAnnotation (fqName = null)
UAnnotationMethod (name = B)
UClass (name = InB)
UAnnotation (fqName = MyAnnotation)
UNamedExpression (name = text)
ULiteralExpression (value = "inB class")
UAnnotationMethod (name = InB)
UClass (name = Companion)
UAnnotation (fqName = MyAnnotation)
UNamedExpression (name = text)
ULiteralExpression (value = "companion")
UAnnotationMethod (name = Companion)
UClass (name = Obj)
UAnnotation (fqName = MyAnnotation)
UNamedExpression (name = text)
ULiteralExpression (value = "object")
UField (name = INSTANCE)
UAnnotation (fqName = null)
UAnnotationMethod (name = Obj)
+23
View File
@@ -0,0 +1,23 @@
public final class A {
public fun A() = UastEmptyExpression
}
public abstract annotation MyAnnotation {
public abstract fun text() : java.lang.String = UastEmptyExpression
}
public final class B {
@null public static final var Companion: B.Companion
public fun B() = UastEmptyExpression
public static final class InB {
public fun InB() = UastEmptyExpression
}
public static final class Companion {
private fun Companion() = UastEmptyExpression
}
}
public final class Obj {
@null public static final var INSTANCE: Obj
private fun Obj() = UastEmptyExpression
}
+1 -1
View File
@@ -1,4 +1,4 @@
public class SimpleScript : kotlin.script.templates.standard.ScriptTemplateWithArgs {
public class SimpleScript {
public final fun getBarOrNull(@org.jetbrains.annotations.NotNull flag: boolean) : SimpleScript.Bar {
return if (flag) <init>(42) else null
}
@@ -26,7 +26,7 @@ UFile (package = ) [public abstract interface Callback {...]
ULambdaExpression [{ ...}] : PsiType:<ErrorType>
UBlockExpression [{...}]
UObjectLiteralExpression [anonymous object : Callback {... }] : PsiType:Callback
UClass (name = null) [final class null {...}]
UClass (name = null) [final class null : Callback {...}]
UAnnotationMethod (name = onError) [public fun onError(@org.jetbrains.annotations.NotNull throwable: java.lang.Throwable) : void {...}]
UParameter (name = throwable) [@org.jetbrains.annotations.NotNull var throwable: java.lang.Throwable]
UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull]