KT-2363 Drop secondary constructors
#KT-2363 Fixed
This commit is contained in:
@@ -108,7 +108,7 @@ public class JetControlFlowTest extends JetLiteFixture {
|
||||
|
||||
JetElement correspondingElement = pseudocode.getCorrespondingElement();
|
||||
String label = "";
|
||||
assert (correspondingElement instanceof JetNamedDeclaration || correspondingElement instanceof JetSecondaryConstructor || correspondingElement instanceof JetPropertyAccessor) :
|
||||
assert (correspondingElement instanceof JetNamedDeclaration || correspondingElement instanceof JetPropertyAccessor) :
|
||||
"Unexpected element class is pseudocode: " + correspondingElement.getClass();
|
||||
if (correspondingElement instanceof JetFunctionLiteral) {
|
||||
label = "anonymous_" + i++;
|
||||
@@ -121,9 +121,6 @@ public class JetControlFlowTest extends JetLiteFixture {
|
||||
String propertyName = ((JetProperty) correspondingElement.getParent()).getName();
|
||||
label = (((JetPropertyAccessor) correspondingElement).isGetter() ? "get" : "set") + "_" + propertyName;
|
||||
}
|
||||
else if (correspondingElement instanceof JetSecondaryConstructor) {
|
||||
label = "this";
|
||||
}
|
||||
|
||||
instructionDump.append("== ").append(label).append(" ==\n");
|
||||
|
||||
|
||||
@@ -15,12 +15,15 @@
|
||||
*/
|
||||
package org.jetbrains.jet.checkers;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import java.io.File;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.test.TestMetadata;
|
||||
|
||||
import java.io.File;
|
||||
import org.jetbrains.jet.checkers.AbstractDiagnosticsTestWithEagerResolve;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.jet.checkers.AbstractDiagnosticsTestWithEagerResolve}. DO NOT MODIFY MANUALLY */
|
||||
public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEagerResolve {
|
||||
@@ -2229,21 +2232,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
|
||||
doTest("compiler/testData/diagnostics/tests/regressions/OverrideResolution.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ScopeForSecondaryConstructors.kt")
|
||||
public void testScopeForSecondaryConstructors() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/regressions/ScopeForSecondaryConstructors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SpecififcityByReceiver.kt")
|
||||
public void testSpecififcityByReceiver() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/regressions/SpecififcityByReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ThisConstructorInGenericClass.kt")
|
||||
public void testThisConstructorInGenericClass() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/regressions/ThisConstructorInGenericClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("TypeMismatchOnUnaryOperations.kt")
|
||||
public void testTypeMismatchOnUnaryOperations() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt");
|
||||
|
||||
@@ -137,11 +137,6 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
blackBoxFile("classes/outerThis.jet");
|
||||
}
|
||||
|
||||
public void testSecondaryConstructors() throws Exception {
|
||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||
blackBoxFile("classes/secondaryConstructors.jet");
|
||||
}
|
||||
|
||||
public void testExceptionConstructor() throws Exception {
|
||||
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
|
||||
blackBoxFile("classes/exceptionConstructor.jet");
|
||||
@@ -332,7 +327,7 @@ public class ClassGenTest extends CodegenTestCase {
|
||||
}
|
||||
|
||||
public void testKt1120 () throws Exception {
|
||||
createEnvironmentWithFullJdk();
|
||||
//createEnvironmentWithFullJdk();
|
||||
// blackBoxFile("regressions/kt1120.kt");
|
||||
}
|
||||
|
||||
|
||||
@@ -767,11 +767,6 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
||||
constructors,
|
||||
null
|
||||
);
|
||||
for (JetSecondaryConstructor constructor : classElement.getSecondaryConstructors()) {
|
||||
ConstructorDescriptorImpl functionDescriptor = descriptorResolver.resolveSecondaryConstructorDescriptor(memberDeclarations, classDescriptor, constructor, JetTestUtils.DUMMY_TRACE);
|
||||
functionDescriptor.setReturnType(classDescriptor.getDefaultType());
|
||||
constructors.add(functionDescriptor);
|
||||
}
|
||||
ConstructorDescriptorImpl primaryConstructorDescriptor = descriptorResolver.resolvePrimaryConstructorDescriptor(scope, classDescriptor, classElement, JetTestUtils.DUMMY_TRACE);
|
||||
if (primaryConstructorDescriptor != null) {
|
||||
primaryConstructorDescriptor.setReturnType(classDescriptor.getDefaultType());
|
||||
|
||||
Reference in New Issue
Block a user