Resolve annotations on secondary constructors
This commit is contained in:
@@ -143,6 +143,7 @@ public class BodyResolver {
|
||||
@NotNull final ConstructorDescriptor descriptor,
|
||||
@NotNull JetScope bodyDeclaringScope
|
||||
) {
|
||||
AnnotationResolver.resolveAnnotationsArguments(constructor.getModifierList(), trace);
|
||||
assert descriptor.getContainingDeclaration() instanceof ClassDescriptorWithResolutionScopes
|
||||
: "When resolving body it should be class descriptor with resolution scopes";
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
annotation class Ann1
|
||||
annotation class Ann2(val x: Int)
|
||||
|
||||
class A {
|
||||
Ann1 constructor() {}
|
||||
<!NO_VALUE_FOR_PARAMETER!>Ann2<!> constructor(x1: Int) {}
|
||||
Ann2(2) constructor(x1: Int, x2: Int) {}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package
|
||||
|
||||
internal final class A {
|
||||
Ann1() public constructor A()
|
||||
Ann2() public constructor A(/*0*/ x1: kotlin.Int)
|
||||
Ann2(x = IntegerValueType(2): IntegerValueType(2)) public constructor A(/*0*/ x1: kotlin.Int, /*1*/ x2: 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
|
||||
}
|
||||
|
||||
internal final annotation class Ann1 : kotlin.Annotation {
|
||||
public constructor Ann1()
|
||||
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
|
||||
}
|
||||
|
||||
internal final annotation class Ann2 : kotlin.Annotation {
|
||||
public constructor Ann2(/*0*/ x: kotlin.Int)
|
||||
internal final val x: 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
|
||||
}
|
||||
@@ -10457,6 +10457,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ctrsAnnotationResolve.kt")
|
||||
public void testCtrsAnnotationResolve() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/secondaryConstructors/ctrsAnnotationResolve.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("cyclicDelegationCalls.kt")
|
||||
public void testCyclicDelegationCalls() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/secondaryConstructors/cyclicDelegationCalls.kt");
|
||||
|
||||
Reference in New Issue
Block a user