[AA] Cover both static and inner classes in Java member scope tests
^KT-61900
This commit is contained in:
committed by
Space Team
parent
ab717c25d7
commit
dab06c0942
Vendored
+4
@@ -14,6 +14,8 @@ public interface SuperInterface {
|
||||
public abstract class SuperClass implements SuperInterface {
|
||||
public static class NestedSuperClass { }
|
||||
|
||||
public class InnerSuperClass { }
|
||||
|
||||
@Override
|
||||
public int getActualRandomNumber() {
|
||||
return getRandomNumber();
|
||||
@@ -30,6 +32,8 @@ public abstract class SuperClass implements SuperInterface {
|
||||
public class JavaClass extends SuperClass {
|
||||
public static class NestedClass { }
|
||||
|
||||
public class InnerClass { }
|
||||
|
||||
public static int foo = 1;
|
||||
|
||||
public static String bar() {
|
||||
|
||||
+2
@@ -4,6 +4,8 @@ open fun hello()
|
||||
|
||||
open var foo: kotlin.Int
|
||||
|
||||
open inner class InnerClass
|
||||
|
||||
open class NestedClass
|
||||
|
||||
constructor()
|
||||
Vendored
+29
@@ -86,6 +86,35 @@ KtJavaFieldSymbol:
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: JavaClass.InnerClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: true
|
||||
modality: OPEN
|
||||
name: InnerClass
|
||||
origin: JAVA
|
||||
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: JavaClass.NestedClass
|
||||
|
||||
+4
@@ -14,6 +14,8 @@ public interface SuperInterface {
|
||||
public abstract class SuperClass implements SuperInterface {
|
||||
public static class NestedSuperClass { }
|
||||
|
||||
public class InnerSuperClass { }
|
||||
|
||||
@Override
|
||||
public int getActualRandomNumber() {
|
||||
return getRandomNumber();
|
||||
@@ -30,6 +32,8 @@ public abstract class SuperClass implements SuperInterface {
|
||||
public class JavaClass extends SuperClass {
|
||||
public static class NestedClass { }
|
||||
|
||||
public class InnerClass { }
|
||||
|
||||
public static int foo = 1;
|
||||
|
||||
public static String bar() {
|
||||
|
||||
Vendored
+2
@@ -1,3 +1,5 @@
|
||||
open fun hello()
|
||||
|
||||
open inner class InnerClass
|
||||
|
||||
constructor()
|
||||
|
||||
+29
@@ -34,6 +34,35 @@ KtFunctionSymbol:
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: JavaClass.InnerClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: true
|
||||
modality: OPEN
|
||||
name: InnerClass
|
||||
origin: JAVA
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtConstructorSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
|
||||
+4
@@ -14,6 +14,8 @@ public interface SuperInterface {
|
||||
public abstract class SuperClass implements SuperInterface {
|
||||
public static class NestedSuperClass { }
|
||||
|
||||
public class InnerSuperClass { }
|
||||
|
||||
@Override
|
||||
public int getActualRandomNumber() {
|
||||
return getRandomNumber();
|
||||
@@ -30,6 +32,8 @@ public abstract class SuperClass implements SuperInterface {
|
||||
public class JavaClass extends SuperClass {
|
||||
public static class NestedClass { }
|
||||
|
||||
public class InnerClass { }
|
||||
|
||||
public static int foo = 1;
|
||||
|
||||
public static String bar() {
|
||||
|
||||
+4
@@ -11,6 +11,10 @@ open fun toString(): kotlin.String
|
||||
|
||||
open class NestedClass
|
||||
|
||||
open inner class InnerClass
|
||||
|
||||
open class NestedSuperClass
|
||||
|
||||
open inner class InnerSuperClass
|
||||
|
||||
constructor()
|
||||
|
||||
+58
@@ -233,6 +233,35 @@ KtNamedClassOrObjectSymbol:
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: JavaClass.InnerClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: true
|
||||
modality: OPEN
|
||||
name: InnerClass
|
||||
origin: JAVA
|
||||
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: SuperClass.NestedSuperClass
|
||||
@@ -262,6 +291,35 @@ KtNamedClassOrObjectSymbol:
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: SuperClass.InnerSuperClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: true
|
||||
modality: OPEN
|
||||
name: InnerSuperClass
|
||||
origin: JAVA
|
||||
superTypes: [
|
||||
KtUsualClassType:
|
||||
annotationsList: []
|
||||
ownTypeArguments: []
|
||||
type: kotlin/Any
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
|
||||
KtConstructorSymbol:
|
||||
annotationsList: []
|
||||
callableIdIfNonLocal: null
|
||||
|
||||
Vendored
+4
@@ -14,6 +14,8 @@ public interface SuperInterface {
|
||||
public abstract class SuperClass implements SuperInterface {
|
||||
public static class NestedSuperClass { }
|
||||
|
||||
public class InnerSuperClass { }
|
||||
|
||||
@Override
|
||||
public int getActualRandomNumber() {
|
||||
return getRandomNumber();
|
||||
@@ -30,6 +32,8 @@ public abstract class SuperClass implements SuperInterface {
|
||||
public class JavaClass extends SuperClass {
|
||||
public static class NestedClass { }
|
||||
|
||||
public class InnerClass { }
|
||||
|
||||
public static int foo = 1;
|
||||
|
||||
public static String bar() {
|
||||
|
||||
+2
@@ -2,4 +2,6 @@ open fun bar(): kotlin.String!
|
||||
|
||||
open var foo: kotlin.Int
|
||||
|
||||
open inner class InnerClass
|
||||
|
||||
open class NestedClass
|
||||
Vendored
+29
@@ -50,6 +50,35 @@ KtJavaFieldSymbol:
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
deprecationStatus: null
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: JavaClass.InnerClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: true
|
||||
modality: OPEN
|
||||
name: InnerClass
|
||||
origin: JAVA
|
||||
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: JavaClass.NestedClass
|
||||
|
||||
+6
-4
@@ -16,8 +16,9 @@ public interface SuperInterface {
|
||||
public abstract class SuperClass implements SuperInterface {
|
||||
// NestedSuperClass will not be included in JavaClass's static member scope, because Kotlin does not propagate static nested classes
|
||||
// defined in super-classes to sub-classes, unlike Java. So `JavaClass.SuperClass` is valid in Java, but an error in Kotlin.
|
||||
class NestedSuperClass {
|
||||
}
|
||||
public static class NestedSuperClass { }
|
||||
|
||||
public class InnerSuperClass { }
|
||||
|
||||
@Override
|
||||
public int getActualRandomNumber() {
|
||||
@@ -35,8 +36,9 @@ public abstract class SuperClass implements SuperInterface {
|
||||
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass extends SuperClass {
|
||||
class NestedClass {
|
||||
}
|
||||
public static class NestedClass { }
|
||||
|
||||
public class InnerClass { }
|
||||
|
||||
public static int foo = 1;
|
||||
|
||||
|
||||
Vendored
+3
-1
@@ -6,4 +6,6 @@ open fun superBar(): kotlin.String!
|
||||
|
||||
open var foo: kotlin.Int
|
||||
|
||||
open inner class NestedClass
|
||||
open inner class InnerClass
|
||||
|
||||
open class NestedClass
|
||||
+31
-2
@@ -104,7 +104,7 @@ KtJavaFieldSymbol:
|
||||
|
||||
KtNamedClassOrObjectSymbol:
|
||||
annotationsList: []
|
||||
classIdIfNonLocal: JavaClass.NestedClass
|
||||
classIdIfNonLocal: JavaClass.InnerClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
@@ -116,6 +116,35 @@ KtNamedClassOrObjectSymbol:
|
||||
isInline: false
|
||||
isInner: true
|
||||
modality: OPEN
|
||||
name: InnerClass
|
||||
origin: JAVA
|
||||
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: JavaClass.NestedClass
|
||||
classKind: CLASS
|
||||
companionObject: null
|
||||
contextReceivers: []
|
||||
isActual: false
|
||||
isData: false
|
||||
isExpect: false
|
||||
isExternal: false
|
||||
isFun: false
|
||||
isInline: false
|
||||
isInner: false
|
||||
modality: OPEN
|
||||
name: NestedClass
|
||||
origin: JAVA
|
||||
superTypes: [
|
||||
@@ -126,7 +155,7 @@ KtNamedClassOrObjectSymbol:
|
||||
]
|
||||
symbolKind: CLASS_MEMBER
|
||||
typeParameters: []
|
||||
visibility: PackageVisibility
|
||||
visibility: Public
|
||||
getContainingModule: KtSourceModule "Sources of main"
|
||||
annotationApplicableTargets: null
|
||||
deprecationStatus: null
|
||||
Reference in New Issue
Block a user