From f94f391a4e161425481b9469e341265c3b41e1b1 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Thu, 19 Dec 2013 18:38:25 +0400 Subject: [PATCH] Use scope based on constructor descriptor (rather than class itself) when resolving class initializers --- .../lang/resolve/lazy/descriptors/LazyClassDescriptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/descriptors/LazyClassDescriptor.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/descriptors/LazyClassDescriptor.java index f7241cde1f2..34354e2dbdf 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/descriptors/LazyClassDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/lazy/descriptors/LazyClassDescriptor.java @@ -210,14 +210,14 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements LazyDesc ConstructorDescriptor primaryConstructor = getUnsubstitutedPrimaryConstructor(); if (primaryConstructor == null) return getScopeForMemberDeclarationResolution(); - WritableScopeImpl scope = new WritableScopeImpl(JetScope.EMPTY, this, RedeclarationHandler.DO_NOTHING, "Scope with constructor parameters in " + getName()); + WritableScopeImpl scope = new WritableScopeImpl(JetScope.EMPTY, primaryConstructor, RedeclarationHandler.DO_NOTHING, "Scope with constructor parameters in " + getName()); for (ValueParameterDescriptor valueParameterDescriptor : primaryConstructor.getValueParameters()) { scope.addVariableDescriptor(valueParameterDescriptor); } scope.changeLockLevel(WritableScope.LockLevel.READING); return new ChainedScope( - this, + primaryConstructor, "ScopeForPropertyInitializerResolution: " + getName(), scope, getScopeForMemberDeclarationResolution()); }