Allow to use "static" part of class in own constructors by short name, including in primary constructor
This commit is contained in:
+3
@@ -27,6 +27,9 @@ public interface ClassDescriptorWithResolutionScopes extends ClassDescriptor {
|
||||
@NotNull
|
||||
LexicalScope getScopeForClassHeaderResolution();
|
||||
|
||||
@NotNull
|
||||
LexicalScope getScopeForConstructorHeaderResolution();
|
||||
|
||||
@NotNull
|
||||
LexicalScope getScopeForMemberDeclarationResolution();
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ public class BodyResolver {
|
||||
|
||||
resolveDelegationSpecifierList(c.getOuterDataFlowInfo(), classOrObject, descriptor,
|
||||
descriptor.getUnsubstitutedPrimaryConstructor(),
|
||||
descriptor.getScopeForClassHeaderResolution(),
|
||||
descriptor.getScopeForConstructorHeaderResolution(),
|
||||
descriptor.getScopeForMemberDeclarationResolution());
|
||||
}
|
||||
}
|
||||
@@ -249,13 +249,13 @@ public class BodyResolver {
|
||||
@NotNull KtClassOrObject jetClass,
|
||||
@NotNull final ClassDescriptor descriptor,
|
||||
@Nullable final ConstructorDescriptor primaryConstructor,
|
||||
@NotNull LexicalScope scopeForSupertypeResolution,
|
||||
@NotNull LexicalScope scopeForConstructorResolution,
|
||||
@NotNull final LexicalScope scopeForMemberResolution
|
||||
) {
|
||||
final LexicalScope scopeForConstructor =
|
||||
primaryConstructor == null
|
||||
? null
|
||||
: FunctionDescriptorUtil.getFunctionInnerScope(scopeForSupertypeResolution, primaryConstructor, trace);
|
||||
: FunctionDescriptorUtil.getFunctionInnerScope(scopeForConstructorResolution, primaryConstructor, trace);
|
||||
final ExpressionTypingServices typeInferrer = expressionTypingServices; // TODO : flow
|
||||
|
||||
final Map<KtTypeReference, KotlinType> supertypes = Maps.newLinkedHashMap();
|
||||
@@ -556,7 +556,7 @@ public class BodyResolver {
|
||||
if (unsubstitutedPrimaryConstructor != null) {
|
||||
ForceResolveUtil.forceResolveAllContents(unsubstitutedPrimaryConstructor.getAnnotations());
|
||||
|
||||
LexicalScope parameterScope = getPrimaryConstructorParametersScope(classDescriptor.getScopeForClassHeaderResolution(),
|
||||
LexicalScope parameterScope = getPrimaryConstructorParametersScope(classDescriptor.getScopeForConstructorHeaderResolution(),
|
||||
unsubstitutedPrimaryConstructor);
|
||||
valueParameterResolver.resolveValueParameters(klass.getPrimaryConstructorParameters(),
|
||||
unsubstitutedPrimaryConstructor.getValueParameters(),
|
||||
|
||||
+23
-11
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.getSuperClassNotAny
|
||||
import org.jetbrains.kotlin.resolve.scopes.*
|
||||
import org.jetbrains.kotlin.resolve.scopes.utils.ThrowingLexicalScope
|
||||
import org.jetbrains.kotlin.storage.StorageManager
|
||||
import org.jetbrains.kotlin.utils.addIfNotNull
|
||||
import java.util.*
|
||||
@@ -42,13 +43,17 @@ class ClassResolutionScopesSupport(
|
||||
scopeWithGenerics(getOuterScope())
|
||||
}
|
||||
|
||||
public val scopeForConstructorHeaderResolution: () -> LexicalScope = storageManager.createLazyValue {
|
||||
scopeWithGenerics(scopeForStaticMemberDeclarationResolution())
|
||||
}
|
||||
|
||||
private val inheritanceScope: () -> LexicalScope = storageManager.createLazyValueWithPostCompute(
|
||||
{
|
||||
classDescriptor.getAllSuperclassesAndMeWithoutAny().asReversed().fold(getOuterScope()) { scope, currentClass ->
|
||||
createInheritanceScope(parent = scope, ownerDescriptor = classDescriptor, classDescriptor = currentClass)
|
||||
}
|
||||
},
|
||||
{ createInheritanceScope(getOuterScope(), classDescriptor, classDescriptor) },
|
||||
createThrowingLexicalScope,
|
||||
{}
|
||||
)
|
||||
|
||||
@@ -59,15 +64,19 @@ class ClassResolutionScopesSupport(
|
||||
LexicalScopeKind.CLASS_MEMBER_SCOPE)
|
||||
}
|
||||
|
||||
public val scopeForStaticMemberDeclarationResolution: () -> LexicalScope = storageManager.createLazyValue {
|
||||
if (classDescriptor.kind.isSingleton) {
|
||||
scopeForMemberDeclarationResolution()
|
||||
}
|
||||
else {
|
||||
LexicalScopeImpl(inheritanceScope(), classDescriptor, false, null,
|
||||
LexicalScopeKind.CLASS_STATIC_SCOPE)
|
||||
}
|
||||
}
|
||||
public val scopeForStaticMemberDeclarationResolution: () -> LexicalScope = storageManager.createLazyValueWithPostCompute(
|
||||
{
|
||||
if (classDescriptor.kind.isSingleton) {
|
||||
scopeForMemberDeclarationResolution()
|
||||
}
|
||||
else {
|
||||
LexicalScopeImpl(inheritanceScope(), classDescriptor, false, null,
|
||||
LexicalScopeKind.CLASS_STATIC_SCOPE)
|
||||
}
|
||||
},
|
||||
createThrowingLexicalScope,
|
||||
{}
|
||||
)
|
||||
|
||||
public val scopeForInitializerResolution: () -> LexicalScope = storageManager.createLazyValue {
|
||||
val primaryConstructor = classDescriptor.unsubstitutedPrimaryConstructor ?:
|
||||
@@ -118,4 +127,7 @@ class ClassResolutionScopesSupport(
|
||||
memberScopes = *staticScopes.toTypedArray(), isStaticScope = true)
|
||||
}
|
||||
|
||||
}
|
||||
companion object {
|
||||
private val createThrowingLexicalScope: (Boolean) -> LexicalScope = { ThrowingLexicalScope() }
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -292,6 +292,12 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
|
||||
return resolutionScopesSupport.getScopeForClassHeaderResolution().invoke();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public LexicalScope getScopeForConstructorHeaderResolution() {
|
||||
return resolutionScopesSupport.getScopeForConstructorHeaderResolution().invoke();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public LexicalScope getScopeForMemberDeclarationResolution() {
|
||||
|
||||
+4
-3
@@ -221,7 +221,8 @@ public open class LazyClassMemberScope(
|
||||
val parameter = primaryConstructorParameters.get(valueParameterDescriptor.index)
|
||||
if (parameter.hasValOrVar()) {
|
||||
val propertyDescriptor = c.descriptorResolver.resolvePrimaryConstructorParameterToAProperty(
|
||||
thisDescriptor, valueParameterDescriptor, thisDescriptor.getScopeForClassHeaderResolution(), parameter, trace)
|
||||
// TODO: can't test because we get types from cache for this case
|
||||
thisDescriptor, valueParameterDescriptor, thisDescriptor.scopeForConstructorHeaderResolution, parameter, trace)
|
||||
result.add(propertyDescriptor)
|
||||
}
|
||||
}
|
||||
@@ -281,7 +282,7 @@ public open class LazyClassMemberScope(
|
||||
|
||||
if (DescriptorUtils.canHaveDeclaredConstructors(thisDescriptor) || hasPrimaryConstructor) {
|
||||
val constructor = c.functionDescriptorResolver.resolvePrimaryConstructorDescriptor(
|
||||
thisDescriptor.getScopeForClassHeaderResolution(), thisDescriptor, classOrObject, trace)
|
||||
thisDescriptor.scopeForConstructorHeaderResolution, thisDescriptor, classOrObject, trace)
|
||||
constructor ?: return null
|
||||
setDeferredReturnType(constructor)
|
||||
return constructor
|
||||
@@ -298,7 +299,7 @@ public open class LazyClassMemberScope(
|
||||
|
||||
return classOrObject.getSecondaryConstructors().map { constructor ->
|
||||
val descriptor = c.functionDescriptorResolver.resolveSecondaryConstructorDescriptor(
|
||||
thisDescriptor.getScopeForClassHeaderResolution(), thisDescriptor, constructor, trace
|
||||
thisDescriptor.scopeForConstructorHeaderResolution, thisDescriptor, constructor, trace
|
||||
)
|
||||
setDeferredReturnType(descriptor)
|
||||
descriptor
|
||||
|
||||
@@ -55,6 +55,7 @@ interface LexicalScope: HierarchicalScope {
|
||||
|
||||
enum class LexicalScopeKind(val withLocalDescriptors: Boolean) {
|
||||
EMPTY(false),
|
||||
THROWING(false),
|
||||
|
||||
CLASS_HEADER(false),
|
||||
CLASS_INHERITANCE(false),
|
||||
@@ -147,4 +148,4 @@ abstract class BaseImportingScope(parent: ImportingScope?) : BaseHierarchicalSco
|
||||
override fun getContributedSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor> = emptyList()
|
||||
|
||||
override fun getContributedSyntheticExtensionFunctions(receiverTypes: Collection<KotlinType>): Collection<FunctionDescriptor> = emptyList()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,3 +245,32 @@ fun chainImportingScopes(scopes: List<ImportingScope>, tail: ImportingScope? = n
|
||||
scope.withParent(current)
|
||||
}
|
||||
}
|
||||
|
||||
class ThrowingLexicalScope : LexicalScope {
|
||||
override val parent: HierarchicalScope
|
||||
get() = throw IllegalStateException()
|
||||
|
||||
override val ownerDescriptor: DeclarationDescriptor
|
||||
get() = throw IllegalStateException()
|
||||
override val isOwnerDescriptorAccessibleByLabel: Boolean
|
||||
get() = throw IllegalStateException()
|
||||
override val implicitReceiver: ReceiverParameterDescriptor?
|
||||
get() = throw IllegalStateException()
|
||||
override val kind: LexicalScopeKind
|
||||
get() = LexicalScopeKind.THROWING
|
||||
|
||||
override fun printStructure(p: Printer) =
|
||||
throw IllegalStateException()
|
||||
|
||||
override fun getContributedClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? =
|
||||
throw IllegalStateException()
|
||||
|
||||
override fun getContributedVariables(name: Name, location: LookupLocation): Collection<VariableDescriptor> =
|
||||
throw IllegalStateException()
|
||||
|
||||
override fun getContributedFunctions(name: Name, location: LookupLocation): Collection<FunctionDescriptor> =
|
||||
throw IllegalStateException()
|
||||
|
||||
override fun getContributedDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection<DeclarationDescriptor> =
|
||||
throw IllegalStateException()
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
annotation class Ann(
|
||||
val kc1: KClass<*>,
|
||||
val kc2: KClass<*>,
|
||||
val kc3: KClass<*>,
|
||||
val c: Int,
|
||||
val cc: Int,
|
||||
val cn: Int,
|
||||
val ci: Int,
|
||||
val t1: Int,
|
||||
val t2: Int
|
||||
)
|
||||
|
||||
@Ann(
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>Nested<!>::class<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>Inner<!>::class<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>Interface<!>::class<!>,
|
||||
<!UNRESOLVED_REFERENCE!>CONST<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>Companion<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>CONST<!><!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>Nested<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>CONST<!><!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!><!UNRESOLVED_REFERENCE!>Interface<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>CONST<!><!>,
|
||||
<!UNRESOLVED_REFERENCE!>a<!>,
|
||||
<!UNRESOLVED_REFERENCE!>b<!>()
|
||||
)
|
||||
class A {
|
||||
|
||||
class Nested {
|
||||
companion object {
|
||||
const val CONST = 2
|
||||
}
|
||||
}
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface {
|
||||
companion object {
|
||||
const val CONST = 3
|
||||
}
|
||||
}
|
||||
|
||||
val a = 1
|
||||
fun b() = 2
|
||||
|
||||
companion object {
|
||||
const val CONST = 1
|
||||
fun foo(): Nested = null!!
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package
|
||||
|
||||
@Ann() public final class A {
|
||||
public constructor A()
|
||||
public final val a: kotlin.Int = 1
|
||||
public final fun b(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): A.Nested
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 3
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final annotation class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ kc1: kotlin.reflect.KClass<*>, /*1*/ kc2: kotlin.reflect.KClass<*>, /*2*/ kc3: kotlin.reflect.KClass<*>, /*3*/ c: kotlin.Int, /*4*/ cc: kotlin.Int, /*5*/ cn: kotlin.Int, /*6*/ ci: kotlin.Int, /*7*/ t1: kotlin.Int, /*8*/ t2: kotlin.Int)
|
||||
public final val c: kotlin.Int
|
||||
public final val cc: kotlin.Int
|
||||
public final val ci: kotlin.Int
|
||||
public final val cn: kotlin.Int
|
||||
public final val kc1: kotlin.reflect.KClass<*>
|
||||
public final val kc2: kotlin.reflect.KClass<*>
|
||||
public final val kc3: kotlin.reflect.KClass<*>
|
||||
public final val t1: kotlin.Int
|
||||
public final val t2: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
annotation class Ann(
|
||||
val kc1: KClass<*>,
|
||||
val kc2: KClass<*>,
|
||||
val kc3: KClass<*>,
|
||||
val c: Int,
|
||||
val cc: Int,
|
||||
val cn: Int,
|
||||
val ci: Int,
|
||||
val t1: Int,
|
||||
val t2: Int
|
||||
)
|
||||
|
||||
class A
|
||||
@Ann(
|
||||
Nested::class,
|
||||
Inner::class,
|
||||
Interface::class,
|
||||
CONST,
|
||||
Companion.CONST,
|
||||
Nested.CONST,
|
||||
Interface.CONST,
|
||||
<!UNRESOLVED_REFERENCE!>a<!>,
|
||||
<!UNRESOLVED_REFERENCE!>b<!>()
|
||||
)
|
||||
constructor() {
|
||||
|
||||
@Ann(
|
||||
Nested::class,
|
||||
Inner::class,
|
||||
Interface::class,
|
||||
CONST,
|
||||
Companion.CONST,
|
||||
Nested.CONST,
|
||||
Interface.CONST,
|
||||
<!UNRESOLVED_REFERENCE!>a<!>,
|
||||
<!UNRESOLVED_REFERENCE!>b<!>()
|
||||
)
|
||||
constructor(dummy: Int) : this()
|
||||
|
||||
class Nested {
|
||||
companion object {
|
||||
const val CONST = 2
|
||||
}
|
||||
}
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface {
|
||||
companion object {
|
||||
const val CONST = 3
|
||||
}
|
||||
}
|
||||
|
||||
val a = 1
|
||||
fun b() = 2
|
||||
|
||||
companion object {
|
||||
const val CONST = 1
|
||||
fun foo(): Nested = null!!
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package
|
||||
|
||||
public final class A {
|
||||
@Ann(c = 1, cc = 1, ci = 3, cn = 2, kc1 = A.Nested::class, kc2 = A.Inner::class, kc3 = A.Interface::class) public constructor A()
|
||||
@Ann(c = 1, cc = 1, ci = 3, cn = 2, kc1 = A.Nested::class, kc2 = A.Inner::class, kc3 = A.Interface::class) public constructor A(/*0*/ dummy: kotlin.Int)
|
||||
public final val a: kotlin.Int = 1
|
||||
public final fun b(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): A.Nested
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 3
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final annotation class Ann : kotlin.Annotation {
|
||||
public constructor Ann(/*0*/ kc1: kotlin.reflect.KClass<*>, /*1*/ kc2: kotlin.reflect.KClass<*>, /*2*/ kc3: kotlin.reflect.KClass<*>, /*3*/ c: kotlin.Int, /*4*/ cc: kotlin.Int, /*5*/ cn: kotlin.Int, /*6*/ ci: kotlin.Int, /*7*/ t1: kotlin.Int, /*8*/ t2: kotlin.Int)
|
||||
public final val c: kotlin.Int
|
||||
public final val cc: kotlin.Int
|
||||
public final val ci: kotlin.Int
|
||||
public final val cn: kotlin.Int
|
||||
public final val kc1: kotlin.reflect.KClass<*>
|
||||
public final val kc2: kotlin.reflect.KClass<*>
|
||||
public final val kc3: kotlin.reflect.KClass<*>
|
||||
public final val t1: kotlin.Int
|
||||
public final val t2: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class A<T : <!UNRESOLVED_REFERENCE!>Nested<!>, F: <!UNRESOLVED_REFERENCE!>Inner<!>, G: <!UNRESOLVED_REFERENCE!>Interace<!>> {
|
||||
|
||||
class Nested
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface
|
||||
}
|
||||
|
||||
class B<T, F, G> where T : <!UNRESOLVED_REFERENCE!>Nested<!>, F: <!UNRESOLVED_REFERENCE!>Inner<!>, G: <!UNRESOLVED_REFERENCE!>Interace<!> {
|
||||
|
||||
class Nested
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface
|
||||
}
|
||||
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
package
|
||||
|
||||
public final class A</*0*/ T : [ERROR : Nested], /*1*/ F : [ERROR : Inner], /*2*/ G : [ERROR : Interace]> {
|
||||
public constructor A</*0*/ T : [ERROR : Nested], /*1*/ F : [ERROR : Inner], /*2*/ G : [ERROR : Interace]>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final inner class Inner /*captured type parameters: /*0*/ T : [ERROR : Nested], /*1*/ F : [ERROR : Inner], /*2*/ G : [ERROR : Interace]*/ {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class B</*0*/ T : [ERROR : Nested], /*1*/ F : [ERROR : Inner], /*2*/ G : [ERROR : Interace]> {
|
||||
public constructor B</*0*/ T : [ERROR : Nested], /*1*/ F : [ERROR : Inner], /*2*/ G : [ERROR : Interace]>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final inner class Inner /*captured type parameters: /*0*/ T : [ERROR : Nested], /*1*/ F : [ERROR : Inner], /*2*/ G : [ERROR : Interace]*/ {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface I<F, G, H>
|
||||
|
||||
class A(impl: Interface) : <!UNRESOLVED_REFERENCE!>Nested<!>(), <!UNRESOLVED_REFERENCE, DELEGATION_NOT_TO_INTERFACE!>Interface<!> by impl, <!UNRESOLVED_REFERENCE!>Inner<!>, I<<!UNRESOLVED_REFERENCE!>Nested<!>, <!UNRESOLVED_REFERENCE!>Interface<!>, <!UNRESOLVED_REFERENCE!>Inner<!>> {
|
||||
|
||||
class Nested
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package
|
||||
|
||||
public final class A : I<[ERROR : Nested], [ERROR : Interface], [ERROR : Inner]> {
|
||||
public constructor A(/*0*/ impl: A.Interface)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public interface I</*0*/ F, /*1*/ G, /*2*/ H> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
class A(
|
||||
n: Nested = foo(),
|
||||
n2: Nested = Nested(),
|
||||
inn: Inner = null!!,
|
||||
inn2: Inner = <!UNRESOLVED_REFERENCE!>Inner<!>(),
|
||||
i: Interface = null!!,
|
||||
c: Int = CONST,
|
||||
cc: Int = Companion.CONST,
|
||||
cn: Int = Nested.CONST,
|
||||
ci: Int = Interface.CONST,
|
||||
t1: Int = <!UNRESOLVED_REFERENCE!>a<!>,
|
||||
t2: Int = <!UNRESOLVED_REFERENCE!>b<!>()
|
||||
) {
|
||||
|
||||
constructor(
|
||||
dummy: Int,
|
||||
n: Nested = foo(),
|
||||
n2: Nested = Nested(),
|
||||
inn: Inner = null!!,
|
||||
inn2: Inner = <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>Inner<!>(),
|
||||
i: Interface = null!!,
|
||||
c: Int = CONST,
|
||||
cc: Int = Companion.CONST,
|
||||
cn: Int = Nested.CONST,
|
||||
ci: Int = Interface.CONST,
|
||||
t1: Int = <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>a<!>,
|
||||
t2: Int = <!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>b<!>()
|
||||
) : this(
|
||||
foo(),
|
||||
Nested(),
|
||||
inn,
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>Inner<!>(),
|
||||
i,
|
||||
CONST,
|
||||
Companion.CONST,
|
||||
Nested.CONST,
|
||||
Interface.CONST,
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>a<!>,
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>b<!>()
|
||||
)
|
||||
|
||||
class Nested {
|
||||
companion object {
|
||||
const val CONST = 2
|
||||
}
|
||||
}
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface {
|
||||
companion object {
|
||||
const val CONST = 3
|
||||
}
|
||||
}
|
||||
|
||||
val a = 1
|
||||
fun b() = 2
|
||||
|
||||
companion object {
|
||||
const val CONST = 1
|
||||
fun foo(): Nested = null!!
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package
|
||||
|
||||
public final class A {
|
||||
public constructor A(/*0*/ n: A.Nested = ..., /*1*/ n2: A.Nested = ..., /*2*/ inn: A.Inner = ..., /*3*/ inn2: A.Inner = ..., /*4*/ i: A.Interface = ..., /*5*/ c: kotlin.Int = ..., /*6*/ cc: kotlin.Int = ..., /*7*/ cn: kotlin.Int = ..., /*8*/ ci: kotlin.Int = ..., /*9*/ t1: kotlin.Int = ..., /*10*/ t2: kotlin.Int = ...)
|
||||
public constructor A(/*0*/ dummy: kotlin.Int, /*1*/ n: A.Nested = ..., /*2*/ n2: A.Nested = ..., /*3*/ inn: A.Inner = ..., /*4*/ inn2: A.Inner = ..., /*5*/ i: A.Interface = ..., /*6*/ c: kotlin.Int = ..., /*7*/ cc: kotlin.Int = ..., /*8*/ cn: kotlin.Int = ..., /*9*/ ci: kotlin.Int = ..., /*10*/ t1: kotlin.Int = ..., /*11*/ t2: kotlin.Int = ...)
|
||||
public final val a: kotlin.Int = 1
|
||||
public final fun b(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): A.Nested
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 3
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface I
|
||||
|
||||
open class S(
|
||||
n: A.Nested,
|
||||
n2: A.Nested,
|
||||
inn: A.Inner,
|
||||
c: Int,
|
||||
cc: Int,
|
||||
cn: Int,
|
||||
ci: Int,
|
||||
t1: Int,
|
||||
t2: Int
|
||||
) : I
|
||||
|
||||
class A : I by S(
|
||||
foo(),
|
||||
Nested(),
|
||||
<!UNRESOLVED_REFERENCE!>Inner<!>(),
|
||||
CONST,
|
||||
Companion.CONST,
|
||||
Nested.CONST,
|
||||
Interface.CONST,
|
||||
<!UNRESOLVED_REFERENCE!>a<!>,
|
||||
<!UNRESOLVED_REFERENCE!>b<!>()
|
||||
) {
|
||||
|
||||
class Nested {
|
||||
companion object {
|
||||
const val CONST = 2
|
||||
}
|
||||
}
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface {
|
||||
companion object {
|
||||
const val CONST = 3
|
||||
}
|
||||
}
|
||||
|
||||
val a = 1
|
||||
fun b() = 2
|
||||
|
||||
companion object {
|
||||
const val CONST = 1
|
||||
fun foo(): Nested = null!!
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package
|
||||
|
||||
public final class A : I {
|
||||
public constructor A()
|
||||
public final val a: kotlin.Int = 1
|
||||
public final fun b(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): A.Nested
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 3
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class S : I {
|
||||
public constructor S(/*0*/ n: A.Nested, /*1*/ n2: A.Nested, /*2*/ inn: A.Inner, /*3*/ c: kotlin.Int, /*4*/ cc: kotlin.Int, /*5*/ cn: kotlin.Int, /*6*/ ci: kotlin.Int, /*7*/ t1: kotlin.Int, /*8*/ t2: kotlin.Int)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface I
|
||||
|
||||
class A : I by impl {
|
||||
|
||||
companion object {
|
||||
val impl = object : I {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package
|
||||
|
||||
public final class A : I {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public final val impl: I
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public interface I {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
open class S(
|
||||
n: A.Nested,
|
||||
n2: A.Nested,
|
||||
inn: A.Inner,
|
||||
c: Int,
|
||||
cc: Int,
|
||||
cn: Int,
|
||||
ci: Int,
|
||||
t1: Int,
|
||||
t2: Int
|
||||
)
|
||||
|
||||
class A : S (
|
||||
foo(),
|
||||
Nested(),
|
||||
<!UNRESOLVED_REFERENCE!>Inner<!>(),
|
||||
CONST,
|
||||
Companion.CONST,
|
||||
Nested.CONST,
|
||||
Interface.CONST,
|
||||
<!UNRESOLVED_REFERENCE!>a<!>,
|
||||
<!UNRESOLVED_REFERENCE!>b<!>()
|
||||
) {
|
||||
|
||||
class Nested {
|
||||
companion object {
|
||||
const val CONST = 2
|
||||
}
|
||||
}
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface {
|
||||
companion object {
|
||||
const val CONST = 3
|
||||
}
|
||||
}
|
||||
|
||||
val a = 1
|
||||
fun b() = 2
|
||||
|
||||
companion object {
|
||||
const val CONST = 1
|
||||
fun foo(): Nested = null!!
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package
|
||||
|
||||
public final class A : S {
|
||||
public constructor A()
|
||||
public final val a: kotlin.Int = 1
|
||||
public final fun b(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): A.Nested
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 3
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public open class S {
|
||||
public constructor S(/*0*/ n: A.Nested, /*1*/ n2: A.Nested, /*2*/ inn: A.Inner, /*3*/ c: kotlin.Int, /*4*/ cc: kotlin.Int, /*5*/ cn: kotlin.Int, /*6*/ ci: kotlin.Int, /*7*/ t1: kotlin.Int, /*8*/ t2: kotlin.Int)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
open class S(
|
||||
n: A.Nested,
|
||||
n2: A.Nested,
|
||||
inn: A.Inner,
|
||||
c: Int,
|
||||
cc: Int,
|
||||
cn: Int,
|
||||
ci: Int,
|
||||
t1: Int,
|
||||
t2: Int
|
||||
)
|
||||
|
||||
class A : S {
|
||||
|
||||
constructor() : super(
|
||||
foo(),
|
||||
Nested(),
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>Inner<!>(),
|
||||
CONST,
|
||||
Companion.CONST,
|
||||
Nested.CONST,
|
||||
Interface.CONST,
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL, UNINITIALIZED_VARIABLE!>a<!>,
|
||||
<!INSTANCE_ACCESS_BEFORE_SUPER_CALL!>b<!>()
|
||||
)
|
||||
|
||||
class Nested {
|
||||
companion object {
|
||||
const val CONST = 2
|
||||
}
|
||||
}
|
||||
|
||||
inner class Inner
|
||||
|
||||
interface Interface {
|
||||
companion object {
|
||||
const val CONST = 3
|
||||
}
|
||||
}
|
||||
|
||||
val a = 1
|
||||
fun b() = 2
|
||||
|
||||
companion object {
|
||||
const val CONST = 1
|
||||
fun foo(): Nested = null!!
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package
|
||||
|
||||
public final class A : S {
|
||||
public constructor A()
|
||||
public final val a: kotlin.Int = 1
|
||||
public final fun b(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 1
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final fun foo(): A.Nested
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final inner class Inner {
|
||||
public constructor Inner()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface Interface {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 3
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
public final class Nested {
|
||||
public constructor Nested()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public const final val CONST: kotlin.Int = 2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public open class S {
|
||||
public constructor S(/*0*/ n: A.Nested, /*1*/ n2: A.Nested, /*2*/ inn: A.Inner, /*3*/ c: kotlin.Int, /*4*/ cc: kotlin.Int, /*5*/ cn: kotlin.Int, /*6*/ ci: kotlin.Int, /*7*/ t1: kotlin.Int, /*8*/ t2: kotlin.Int)
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -13905,6 +13905,69 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/scopes/classHeader")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class ClassHeader extends AbstractDiagnosticsTest {
|
||||
public void testAllFilesPresentInClassHeader() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/scopes/classHeader"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("annotationOnClass.kt")
|
||||
public void testAnnotationOnClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/annotationOnClass.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("annotationOnConstructors.kt")
|
||||
public void testAnnotationOnConstructors() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/annotationOnConstructors.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("classGenericParameters.kt")
|
||||
public void testClassGenericParameters() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/classGenericParameters.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("classParents.kt")
|
||||
public void testClassParents() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/classParents.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("constructors.kt")
|
||||
public void testConstructors() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/constructors.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("delegation.kt")
|
||||
public void testDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/delegation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("simpleDelegation.kt")
|
||||
public void testSimpleDelegation() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/simpleDelegation.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("superConstructorArguments.kt")
|
||||
public void testSuperConstructorArguments() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/superConstructorArguments.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("superConstructorArgumentsInSecondaryConstructor.kt")
|
||||
public void testSuperConstructorArgumentsInSecondaryConstructor() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/scopes/classHeader/superConstructorArgumentsInSecondaryConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/scopes/inheritance")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
@@ -404,9 +404,9 @@ public class ResolveElementCache(
|
||||
bodyResolver.resolveDelegationSpecifierList(DataFlowInfo.EMPTY,
|
||||
classOrObject,
|
||||
descriptor,
|
||||
descriptor.getUnsubstitutedPrimaryConstructor(),
|
||||
descriptor.getScopeForClassHeaderResolution(),
|
||||
descriptor.getScopeForMemberDeclarationResolution())
|
||||
descriptor.unsubstitutedPrimaryConstructor,
|
||||
descriptor.scopeForConstructorHeaderResolution,
|
||||
descriptor.scopeForMemberDeclarationResolution)
|
||||
|
||||
return trace
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ interface I {
|
||||
val p: CCCC.Nested
|
||||
}
|
||||
|
||||
class CCCC(override val p: CCCC.Nested<caret>val x: Int) : I {
|
||||
class CCCC(override val p: Nested<caret>val x: Int) : I {
|
||||
interface Nested
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -2,6 +2,8 @@ package ppp
|
||||
|
||||
import ppp.Base.Nested
|
||||
|
||||
class Base(p: Nested) {
|
||||
fun foo(p: Nested) {}
|
||||
|
||||
class Base {
|
||||
class Nested
|
||||
}
|
||||
|
||||
+3
-1
@@ -2,6 +2,8 @@ package ppp
|
||||
|
||||
import ppp.Base.Nested
|
||||
|
||||
class Base(p: Nested) {
|
||||
fun foo(p: Nested) {}
|
||||
|
||||
class Base {
|
||||
class Nested
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user