Resolve constructors declared in traits and objects
It prevents exceptions and produces less red code #EA-68667 Fixed
This commit is contained in:
@@ -325,6 +325,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ObjectWithConstructor.kt")
|
||||
public void testObjectWithConstructor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/ObjectWithConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OverrideFunctionWithParamDefaultValue.kt")
|
||||
public void testOverrideFunctionWithParamDefaultValue() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/OverrideFunctionWithParamDefaultValue.kt");
|
||||
|
||||
@@ -105,7 +105,7 @@ public abstract class AbstractDescriptorRendererTest : KotlinTestWithEnvironment
|
||||
descriptors.add(descriptor)
|
||||
if (descriptor is ClassDescriptor) {
|
||||
// if class has primary constructor then we visit it later, otherwise add it artificially
|
||||
if (element !is JetClass || !element.hasExplicitPrimaryConstructor()) {
|
||||
if (element !is JetClassOrObject || !element.hasExplicitPrimaryConstructor()) {
|
||||
if (descriptor.getUnsubstitutedPrimaryConstructor() != null) {
|
||||
descriptors.add(descriptor.getUnsubstitutedPrimaryConstructor())
|
||||
}
|
||||
|
||||
@@ -89,12 +89,24 @@ public class DescriptorRendererTestGenerated extends AbstractDescriptorRendererT
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ObjectWithConstructor.kt")
|
||||
public void testObjectWithConstructor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/renderer/ObjectWithConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("StarProjection.kt")
|
||||
public void testStarProjection() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/renderer/StarProjection.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("TraitWithConstructor.kt")
|
||||
public void testTraitWithConstructor() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/renderer/TraitWithConstructor.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("UnitType.kt")
|
||||
public void testUnitType() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/renderer/UnitType.kt");
|
||||
|
||||
Reference in New Issue
Block a user