[AA] Add tests for *static* (declared) member scopes
^KT-61900 ^KT-61800
This commit is contained in:
committed by
Space Team
parent
4ba0aef23b
commit
21efd6aff3
+31
@@ -0,0 +1,31 @@
|
||||
package test
|
||||
|
||||
abstract class A {
|
||||
fun perform() { }
|
||||
|
||||
val x: Int = 0
|
||||
|
||||
class C1
|
||||
|
||||
object O1
|
||||
|
||||
companion object {
|
||||
val y: Int = 0
|
||||
}
|
||||
}
|
||||
|
||||
class C : A() {
|
||||
fun foo(): Int = 5
|
||||
|
||||
val bar: String = ""
|
||||
|
||||
class C2
|
||||
|
||||
object O2
|
||||
|
||||
companion object {
|
||||
val baz: String = ""
|
||||
}
|
||||
}
|
||||
|
||||
// class: test/C
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
class C2
|
||||
|
||||
object O2
|
||||
|
||||
companion object
|
||||
Vendored
+86
@@ -0,0 +1,86 @@
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: test/C.C2
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: C2
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: test/C.O2
|
||||
classKind: OBJECT
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: O2
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: test/C.Companion
|
||||
classKind: COMPANION_OBJECT
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: Companion
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// class: test/KotlinClass
|
||||
// FILE: JavaClass.java
|
||||
package test
|
||||
|
||||
public abstract class JavaClass {
|
||||
public void perform() {
|
||||
}
|
||||
|
||||
public int x = 0;
|
||||
|
||||
public static void hello() {
|
||||
}
|
||||
|
||||
public static int y = 1;
|
||||
|
||||
public class C1 {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KotlinClass.kt
|
||||
package test
|
||||
|
||||
class KotlinClass : JavaClass() {
|
||||
fun foo(): Int = 5
|
||||
|
||||
val bar: String = ""
|
||||
|
||||
class C2
|
||||
|
||||
object O2
|
||||
|
||||
companion object {
|
||||
val baz: String = ""
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class C2
|
||||
|
||||
object O2
|
||||
|
||||
companion object
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: test/KotlinClass.C2
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: C2
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: test/KotlinClass.O2
|
||||
classKind: OBJECT
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: O2
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: test/KotlinClass.Companion
|
||||
classKind: COMPANION_OBJECT
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: FINAL
|
||||
name: Companion
|
||||
origin: SOURCE
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
package test
|
||||
|
||||
enum class E {
|
||||
A {
|
||||
val x: String = ""
|
||||
},
|
||||
B
|
||||
}
|
||||
|
||||
// class: test/E
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
A
|
||||
|
||||
B
|
||||
|
||||
fun values(): kotlin.Array<test.E>
|
||||
|
||||
fun valueOf(value: kotlin.String): test.E
|
||||
|
||||
val entries: kotlin.enums.EnumEntries<test.E>
|
||||
Vendored
+200
@@ -0,0 +1,200 @@
|
||||
KtEnumEntrySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: test/E.A
|
||||
containingEnumClassIdIfNonLocal: test/E
|
||||
contextReceivers: []
|
||||
enumEntryInitializer: KtAnonymousObjectSymbol(<local>/<no name provided>)
|
||||
isExtension: false
|
||||
name: A
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/E
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtEnumEntrySymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: test/E.B
|
||||
containingEnumClassIdIfNonLocal: test/E
|
||||
contextReceivers: []
|
||||
enumEntryInitializer: null
|
||||
isExtension: false
|
||||
name: B
|
||||
origin: SOURCE
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/E
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: test/E.values
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isActual: false
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: true
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: values
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/E
|
||||
]
|
||||
type: kotlin/Array<test/E>
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: test/E.valueOf
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: true
|
||||
isActual: false
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: true
|
||||
isSuspend: false
|
||||
modality: FINAL
|
||||
name: valueOf
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/E
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: [
|
||||
KtValueParameterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
generatedPrimaryConstructorProperty: null
|
||||
hasDefaultValue: false
|
||||
isCrossinline: false
|
||||
isExtension: false
|
||||
isImplicitLambdaParameter: false
|
||||
isNoinline: false
|
||||
isVararg: false
|
||||
name: value
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/String
|
||||
symbolKind: LOCAL
|
||||
typeParameters: []
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
]
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtKotlinPropertySymbol:
|
||||
annotationsList: []
|
||||
backingFieldSymbol: null
|
||||
callableIdIfNonLocal: test/E.entries
|
||||
contextReceivers: []
|
||||
getter: KtPropertyGetterSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
contextReceivers: []
|
||||
hasBody: false
|
||||
hasStableParameterNames: true
|
||||
isDefault: true
|
||||
isExtension: false
|
||||
isInline: false
|
||||
isOverride: false
|
||||
modality: FINAL
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/E
|
||||
]
|
||||
type: kotlin/enums/EnumEntries<test/E>
|
||||
symbolKind: ACCESSOR
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
hasBackingField: false
|
||||
hasGetter: true
|
||||
hasSetter: false
|
||||
initializer: null
|
||||
isActual: false
|
||||
isConst: false
|
||||
isDelegatedProperty: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isFromPrimaryConstructor: false
|
||||
isLateInit: false
|
||||
isOverride: false
|
||||
isStatic: true
|
||||
isVal: true
|
||||
modality: FINAL
|
||||
name: entries
|
||||
origin: SOURCE_MEMBER_GENERATED
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: test/E
|
||||
]
|
||||
type: kotlin/enums/EnumEntries<test/E>
|
||||
setter: null
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
getterDeprecationStatus: null
|
||||
javaGetterName: getEntries
|
||||
javaSetterName: null
|
||||
setterDeprecationStatus: null
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// class: JavaClass
|
||||
// FILE: main.kt
|
||||
|
||||
// FILE: SuperInterface.java
|
||||
public interface SuperInterface {
|
||||
public int getActualRandomNumber();
|
||||
|
||||
public static int getRandomNumber() {
|
||||
return 3; // Decided by a fair dice roll.
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: SuperClass.java
|
||||
public abstract class SuperClass implements SuperInterface {
|
||||
@Override
|
||||
public int getActualRandomNumber() {
|
||||
return getRandomNumber();
|
||||
}
|
||||
|
||||
public static int superFoo = 5;
|
||||
|
||||
public static String superBar() {
|
||||
return "superBar";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass extends SuperClass {
|
||||
public static int foo = 1;
|
||||
|
||||
public static String bar() {
|
||||
return "bar";
|
||||
}
|
||||
|
||||
public void hello() {
|
||||
System.out.println("hello");
|
||||
}
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open var foo: kotlin.Int
|
||||
|
||||
open fun bar(): kotlin.String!
|
||||
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
KtJavaFieldSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /JavaClass.foo
|
||||
contextReceivers: []
|
||||
isExtension: false
|
||||
isStatic: true
|
||||
isVal: false
|
||||
modality: OPEN
|
||||
name: foo
|
||||
origin: JAVA
|
||||
receiverParameter: null
|
||||
returnType: KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Int
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtFunctionSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: /JavaClass.bar
|
||||
contextReceivers: []
|
||||
contractEffects: []
|
||||
hasStableParameterNames: false
|
||||
isActual: false
|
||||
isBuiltinFunctionInvoke: false
|
||||
isExpect: false
|
||||
isExtension: false
|
||||
isExternal: false
|
||||
isInfix: false
|
||||
isInline: false
|
||||
isOperator: false
|
||||
isOverride: false
|
||||
isStatic: true
|
||||
isSuspend: false
|
||||
modality: OPEN
|
||||
name: bar
|
||||
origin: JAVA
|
||||
receiverParameter: null
|
||||
returnType: KtFlexibleType:
|
||||
annotationsList: []
|
||||
type: kotlin/String!
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
valueParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
Reference in New Issue
Block a user