Don't add primary constructors parameters for properties
This commit is contained in:
+4
-1
@@ -245,7 +245,10 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyEnti
|
||||
|
||||
WritableScopeImpl scope = new WritableScopeImpl(JetScope.EMPTY, primaryConstructor, RedeclarationHandler.DO_NOTHING, "Scope with constructor parameters in " + getName());
|
||||
for (ValueParameterDescriptor valueParameterDescriptor : primaryConstructor.getValueParameters()) {
|
||||
scope.addVariableDescriptor(valueParameterDescriptor);
|
||||
JetParameter jetParameter = originalClassInfo.getPrimaryConstructorParameters().get(valueParameterDescriptor.getIndex());
|
||||
if (jetParameter.getValOrVarNode() == null) {
|
||||
scope.addVariableDescriptor(valueParameterDescriptor);
|
||||
}
|
||||
}
|
||||
scope.changeLockLevel(WritableScope.LockLevel.READING);
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class AnonymousInitializers(var a: String) {
|
||||
{
|
||||
a = "s"
|
||||
}
|
||||
}
|
||||
@@ -459,11 +459,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest("compiler/testData/diagnostics/tests/TypeMismatchOnOverrideWithSyntaxErrors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("UninitializedOrReassignedVariables.kt")
|
||||
public void testUninitializedOrReassignedVariables() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/UninitializedOrReassignedVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("UnitByDefaultForFunctionTypes.kt")
|
||||
public void testUnitByDefaultForFunctionTypes() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/UnitByDefaultForFunctionTypes.kt");
|
||||
@@ -1683,11 +1678,21 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/repeatUnitializedErrorOnlyForLocalVars.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("scopeOfAnonymousInitializer.kt")
|
||||
public void testScopeOfAnonymousInitializer() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/scopeOfAnonymousInitializer.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("uninitializedInLocalDeclarations.kt")
|
||||
public void testUninitializedInLocalDeclarations() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/uninitializedInLocalDeclarations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("UninitializedOrReassignedVariables.kt")
|
||||
public void testUninitializedOrReassignedVariables() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/UninitializedOrReassignedVariables.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("unreachableCode.kt")
|
||||
public void testUnreachableCode() throws Exception {
|
||||
doTest("compiler/testData/diagnostics/tests/controlFlowAnalysis/unreachableCode.kt");
|
||||
|
||||
Reference in New Issue
Block a user