[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
+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