Extract interface: ScriptDescriptor
This commit is contained in:
@@ -30,7 +30,9 @@ import org.jetbrains.jet.codegen.state.GenerationState;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ScriptDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
||||
import org.jetbrains.jet.lang.psi.JetScript;
|
||||
import org.jetbrains.jet.lang.psi.JetTypeParameterListOwner;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -63,13 +65,13 @@ public class ScriptCodegen extends MemberCodegen {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JetScript scriptDeclaration;
|
||||
private final JetScript scriptDeclaration;
|
||||
|
||||
@NotNull
|
||||
private final ScriptContext context;
|
||||
|
||||
@NotNull
|
||||
private List<ScriptDescriptor> earlierScripts;
|
||||
private final List<ScriptDescriptor> earlierScripts;
|
||||
|
||||
private ScriptCodegen(
|
||||
@NotNull JetScript scriptDeclaration,
|
||||
|
||||
@@ -19,6 +19,7 @@ package org.jetbrains.jet.lang.resolve;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ScriptDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ScriptDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.PropertyDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
||||
@@ -67,7 +68,7 @@ public class ScriptBodyResolver {
|
||||
public void resolveScriptBodies(@NotNull BodiesResolveContext c) {
|
||||
for (Map.Entry<JetScript, ScriptDescriptor> e : c.getScripts().entrySet()) {
|
||||
JetScript declaration = e.getKey();
|
||||
ScriptDescriptor descriptor = e.getValue();
|
||||
ScriptDescriptorImpl descriptor = (ScriptDescriptorImpl) e.getValue();
|
||||
WritableScope scope = c.getScriptScopes().get(declaration);
|
||||
|
||||
// TODO: lock in resolveScriptDeclarations
|
||||
|
||||
@@ -19,16 +19,12 @@ package org.jetbrains.jet.lang.resolve;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.PackageFragmentDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ScriptDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl;
|
||||
import org.jetbrains.jet.lang.parsing.JetScriptDefinition;
|
||||
import org.jetbrains.jet.lang.parsing.JetScriptDefinitionProvider;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.psi.JetPackageDirective;
|
||||
import org.jetbrains.jet.lang.psi.JetScript;
|
||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
@@ -115,7 +111,7 @@ public class ScriptHeaderResolver {
|
||||
|
||||
FqName nameForScript = ScriptNameUtil.classNameForScript((JetFile) script.getContainingFile());
|
||||
Name className = nameForScript.shortName();
|
||||
ScriptDescriptor scriptDescriptor = new ScriptDescriptor(ns, priority, outerScope, className);
|
||||
ScriptDescriptor scriptDescriptor = new ScriptDescriptorImpl(ns, priority, outerScope, className);
|
||||
|
||||
//WriteThroughScope scriptScope = new WriteThroughScope(
|
||||
// outerScope, ns.getMemberScope(), new TraceBasedRedeclarationHandler(trace));
|
||||
@@ -133,7 +129,7 @@ public class ScriptHeaderResolver {
|
||||
public void resolveScriptDeclarations(@NotNull TopDownAnalysisContext c) {
|
||||
for (Map.Entry<JetScript, ScriptDescriptor> e : c.getScripts().entrySet()) {
|
||||
JetScript declaration = e.getKey();
|
||||
ScriptDescriptor descriptor = e.getValue();
|
||||
ScriptDescriptorImpl descriptor = (ScriptDescriptorImpl) e.getValue();
|
||||
WritableScope scope = c.getScriptScopes().get(declaration);
|
||||
|
||||
List<ValueParameterDescriptor> valueParameters = Lists.newArrayList();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2014 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,173 +17,31 @@
|
||||
package org.jetbrains.jet.lang.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.*;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorFactory;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ScriptReceiver;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.ScriptCodeDescriptor;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
// SCRIPT: Script declaration descriptor
|
||||
public class ScriptDescriptor extends DeclarationDescriptorNonRootImpl {
|
||||
public static final String LAST_EXPRESSION_VALUE_FIELD_NAME = "rv";
|
||||
private static final Name NAME = Name.special("<script>");
|
||||
|
||||
private final int priority;
|
||||
|
||||
private JetType returnType;
|
||||
private List<ValueParameterDescriptor> valueParameters;
|
||||
|
||||
private final ScriptCodeDescriptor scriptCodeDescriptor = new ScriptCodeDescriptor(this);
|
||||
private final ReceiverParameterDescriptor implicitReceiver = new ReceiverParameterDescriptorImpl(this,
|
||||
// Putting Any here makes no sense,
|
||||
// it is simply copied from someplace else
|
||||
// during a refactoring
|
||||
KotlinBuiltIns.getInstance().getAnyType(),
|
||||
new ScriptReceiver(this));
|
||||
|
||||
private final ClassDescriptorImpl classDescriptor;
|
||||
|
||||
private final WritableScopeImpl classScope;
|
||||
|
||||
public ScriptDescriptor(
|
||||
@NotNull DeclarationDescriptor containingDeclaration,
|
||||
int priority,
|
||||
@NotNull JetScope scriptScope,
|
||||
@NotNull Name className
|
||||
) {
|
||||
super(containingDeclaration, Annotations.EMPTY, NAME);
|
||||
this.priority = priority;
|
||||
|
||||
classDescriptor = new ClassDescriptorImpl(containingDeclaration, className, Modality.FINAL,
|
||||
Collections.singleton(KotlinBuiltIns.getInstance().getAnyType()));
|
||||
classScope = new WritableScopeImpl(scriptScope, containingDeclaration, RedeclarationHandler.DO_NOTHING, "script members");
|
||||
classScope.changeLockLevel(WritableScope.LockLevel.BOTH);
|
||||
classDescriptor.initialize(classScope, new HashSet<ConstructorDescriptor>(), null);
|
||||
}
|
||||
|
||||
public void initialize(
|
||||
@NotNull JetType returnType,
|
||||
@NotNull List<? extends PropertyDescriptorImpl> properties,
|
||||
@NotNull List<? extends FunctionDescriptor> functions
|
||||
) {
|
||||
this.returnType = returnType;
|
||||
scriptCodeDescriptor.initialize(implicitReceiver, valueParameters, returnType);
|
||||
|
||||
PropertyDescriptorImpl propertyDescriptor = PropertyDescriptorImpl.create(classDescriptor,
|
||||
Annotations.EMPTY,
|
||||
Modality.FINAL,
|
||||
Visibilities.PUBLIC,
|
||||
false,
|
||||
Name.identifier(LAST_EXPRESSION_VALUE_FIELD_NAME),
|
||||
CallableMemberDescriptor.Kind.DECLARATION);
|
||||
propertyDescriptor.setType(
|
||||
returnType,
|
||||
Collections.<TypeParameterDescriptor>emptyList(),
|
||||
classDescriptor.getThisAsReceiverParameter(),
|
||||
ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER);
|
||||
propertyDescriptor.initialize(null, null);
|
||||
classScope.addPropertyDescriptor(propertyDescriptor);
|
||||
|
||||
for (PropertyDescriptorImpl property : properties) {
|
||||
initializeWithDefaultGetterSetter(property);
|
||||
classScope.addPropertyDescriptor(property);
|
||||
}
|
||||
|
||||
for (FunctionDescriptor function : functions) {
|
||||
classScope.addFunctionDescriptor(function);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initializeWithDefaultGetterSetter(PropertyDescriptorImpl propertyDescriptor) {
|
||||
PropertyGetterDescriptorImpl getter = propertyDescriptor.getGetter();
|
||||
if (getter == null && propertyDescriptor.getVisibility() != Visibilities.PRIVATE) {
|
||||
getter = DescriptorFactory.createDefaultGetter(propertyDescriptor);
|
||||
getter.initialize(propertyDescriptor.getType());
|
||||
}
|
||||
|
||||
PropertySetterDescriptor setter = propertyDescriptor.getSetter();
|
||||
if (setter == null && propertyDescriptor.isVar()) {
|
||||
setter = DescriptorFactory.createDefaultSetter(propertyDescriptor);
|
||||
}
|
||||
propertyDescriptor.initialize(getter, setter);
|
||||
}
|
||||
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
public interface ScriptDescriptor extends Annotated, DeclarationDescriptor, DeclarationDescriptorNonRoot {
|
||||
String LAST_EXPRESSION_VALUE_FIELD_NAME = "rv";
|
||||
Name NAME = Name.special("<script>");
|
||||
|
||||
@NotNull
|
||||
public JetType getReturnType() {
|
||||
return returnType;
|
||||
}
|
||||
JetType getReturnType();
|
||||
|
||||
int getPriority();
|
||||
|
||||
@NotNull
|
||||
public List<ValueParameterDescriptor> getValueParameters() {
|
||||
return valueParameters;
|
||||
}
|
||||
List<ValueParameterDescriptor> getValueParameters();
|
||||
|
||||
@NotNull
|
||||
public ScriptCodeDescriptor getScriptCodeDescriptor() {
|
||||
return scriptCodeDescriptor;
|
||||
}
|
||||
ScriptCodeDescriptor getScriptCodeDescriptor();
|
||||
|
||||
@NotNull
|
||||
public ReceiverParameterDescriptor getThisAsReceiverParameter() {
|
||||
return implicitReceiver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor substitute(@NotNull TypeSubstitutor substitutor) {
|
||||
throw new IllegalStateException("nothing to substitute in script");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitScriptDescriptor(this, data);
|
||||
}
|
||||
|
||||
public void setValueParameters(@NotNull List<ValueParameterDescriptor> valueParameters) {
|
||||
this.valueParameters = valueParameters;
|
||||
ConstructorDescriptorImpl constructorDescriptor =
|
||||
ConstructorDescriptorImpl.create(classDescriptor, Annotations.EMPTY, true)
|
||||
.initialize(Collections.<TypeParameterDescriptor>emptyList(), valueParameters, Visibilities.PUBLIC, false);
|
||||
constructorDescriptor.setReturnType(classDescriptor.getDefaultType());
|
||||
|
||||
classDescriptor.getConstructors().add(constructorDescriptor);
|
||||
classDescriptor.setPrimaryConstructor(constructorDescriptor);
|
||||
|
||||
for (ValueParameterDescriptor parameter : valueParameters) {
|
||||
PropertyDescriptorImpl propertyDescriptor = PropertyDescriptorImpl.create(classDescriptor,
|
||||
Annotations.EMPTY,
|
||||
Modality.FINAL,
|
||||
Visibilities.PUBLIC,
|
||||
false,
|
||||
parameter.getName(),
|
||||
CallableMemberDescriptor.Kind.DECLARATION);
|
||||
propertyDescriptor.setType(
|
||||
parameter.getType(),
|
||||
Collections.<TypeParameterDescriptor>emptyList(),
|
||||
classDescriptor.getThisAsReceiverParameter(), ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER);
|
||||
//PropertyGetterDescriptor getter = DescriptorResolver.createDefaultGetter(propertyDescriptor);
|
||||
//getter.initialize(propertyDescriptor.getType());
|
||||
propertyDescriptor.initialize(null, null);
|
||||
classScope.addPropertyDescriptor(propertyDescriptor);
|
||||
}
|
||||
}
|
||||
ReceiverParameterDescriptor getThisAsReceiverParameter();
|
||||
|
||||
@NotNull
|
||||
public ClassDescriptor getClassDescriptor() {
|
||||
return classDescriptor;
|
||||
}
|
||||
ClassDescriptor getClassDescriptor();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jet.lang.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.jet.lang.descriptors.impl.*;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorFactory;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ScriptReceiver;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
// SCRIPT: Script declaration descriptor
|
||||
public class ScriptDescriptorImpl extends DeclarationDescriptorNonRootImpl implements ScriptDescriptor {
|
||||
|
||||
private final int priority;
|
||||
|
||||
private JetType returnType;
|
||||
private List<ValueParameterDescriptor> valueParameters;
|
||||
|
||||
private final ScriptCodeDescriptor scriptCodeDescriptor = new ScriptCodeDescriptor(this);
|
||||
private final ReceiverParameterDescriptor implicitReceiver = new ReceiverParameterDescriptorImpl(this,
|
||||
// Putting Any here makes no sense,
|
||||
// it is simply copied from someplace else
|
||||
// during a refactoring
|
||||
KotlinBuiltIns.getInstance().getAnyType(),
|
||||
new ScriptReceiver(this));
|
||||
|
||||
private final ClassDescriptorImpl classDescriptor;
|
||||
|
||||
private final WritableScopeImpl classScope;
|
||||
|
||||
public ScriptDescriptorImpl(
|
||||
@NotNull DeclarationDescriptor containingDeclaration,
|
||||
int priority,
|
||||
@NotNull JetScope scriptScope,
|
||||
@NotNull Name className
|
||||
) {
|
||||
super(containingDeclaration, Annotations.EMPTY, NAME);
|
||||
this.priority = priority;
|
||||
|
||||
classDescriptor = new ClassDescriptorImpl(containingDeclaration, className, Modality.FINAL,
|
||||
Collections.singleton(KotlinBuiltIns.getInstance().getAnyType()));
|
||||
classScope = new WritableScopeImpl(scriptScope, containingDeclaration, RedeclarationHandler.DO_NOTHING, "script members");
|
||||
classScope.changeLockLevel(WritableScope.LockLevel.BOTH);
|
||||
classDescriptor.initialize(classScope, new HashSet<ConstructorDescriptor>(), null);
|
||||
}
|
||||
|
||||
public void initialize(
|
||||
@NotNull JetType returnType,
|
||||
@NotNull List<? extends PropertyDescriptorImpl> properties,
|
||||
@NotNull List<? extends FunctionDescriptor> functions
|
||||
) {
|
||||
this.returnType = returnType;
|
||||
scriptCodeDescriptor.initialize(implicitReceiver, valueParameters, returnType);
|
||||
|
||||
PropertyDescriptorImpl propertyDescriptor = PropertyDescriptorImpl.create(classDescriptor,
|
||||
Annotations.EMPTY,
|
||||
Modality.FINAL,
|
||||
Visibilities.PUBLIC,
|
||||
false,
|
||||
Name.identifier(LAST_EXPRESSION_VALUE_FIELD_NAME),
|
||||
CallableMemberDescriptor.Kind.DECLARATION);
|
||||
propertyDescriptor.setType(
|
||||
returnType,
|
||||
Collections.<TypeParameterDescriptor>emptyList(),
|
||||
classDescriptor.getThisAsReceiverParameter(),
|
||||
ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER);
|
||||
propertyDescriptor.initialize(null, null);
|
||||
classScope.addPropertyDescriptor(propertyDescriptor);
|
||||
|
||||
for (PropertyDescriptorImpl property : properties) {
|
||||
initializeWithDefaultGetterSetter(property);
|
||||
classScope.addPropertyDescriptor(property);
|
||||
}
|
||||
|
||||
for (FunctionDescriptor function : functions) {
|
||||
classScope.addFunctionDescriptor(function);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initializeWithDefaultGetterSetter(PropertyDescriptorImpl propertyDescriptor) {
|
||||
PropertyGetterDescriptorImpl getter = propertyDescriptor.getGetter();
|
||||
if (getter == null && propertyDescriptor.getVisibility() != Visibilities.PRIVATE) {
|
||||
getter = DescriptorFactory.createDefaultGetter(propertyDescriptor);
|
||||
getter.initialize(propertyDescriptor.getType());
|
||||
}
|
||||
|
||||
PropertySetterDescriptor setter = propertyDescriptor.getSetter();
|
||||
if (setter == null && propertyDescriptor.isVar()) {
|
||||
setter = DescriptorFactory.createDefaultSetter(propertyDescriptor);
|
||||
}
|
||||
propertyDescriptor.initialize(getter, setter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public JetType getReturnType() {
|
||||
return returnType;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public List<ValueParameterDescriptor> getValueParameters() {
|
||||
return valueParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ScriptCodeDescriptor getScriptCodeDescriptor() {
|
||||
return scriptCodeDescriptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ReceiverParameterDescriptor getThisAsReceiverParameter() {
|
||||
return implicitReceiver;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor substitute(@NotNull TypeSubstitutor substitutor) {
|
||||
throw new IllegalStateException("nothing to substitute in script");
|
||||
}
|
||||
|
||||
@Override
|
||||
public <R, D> R accept(DeclarationDescriptorVisitor<R, D> visitor, D data) {
|
||||
return visitor.visitScriptDescriptor(this, data);
|
||||
}
|
||||
|
||||
public void setValueParameters(@NotNull List<ValueParameterDescriptor> valueParameters) {
|
||||
this.valueParameters = valueParameters;
|
||||
ConstructorDescriptorImpl constructorDescriptor =
|
||||
ConstructorDescriptorImpl.create(classDescriptor, Annotations.EMPTY, true)
|
||||
.initialize(Collections.<TypeParameterDescriptor>emptyList(), valueParameters, Visibilities.PUBLIC, false);
|
||||
constructorDescriptor.setReturnType(classDescriptor.getDefaultType());
|
||||
|
||||
classDescriptor.getConstructors().add(constructorDescriptor);
|
||||
classDescriptor.setPrimaryConstructor(constructorDescriptor);
|
||||
|
||||
for (ValueParameterDescriptor parameter : valueParameters) {
|
||||
PropertyDescriptorImpl propertyDescriptor = PropertyDescriptorImpl.create(classDescriptor,
|
||||
Annotations.EMPTY,
|
||||
Modality.FINAL,
|
||||
Visibilities.PUBLIC,
|
||||
false,
|
||||
parameter.getName(),
|
||||
CallableMemberDescriptor.Kind.DECLARATION);
|
||||
propertyDescriptor.setType(
|
||||
parameter.getType(),
|
||||
Collections.<TypeParameterDescriptor>emptyList(),
|
||||
classDescriptor.getThisAsReceiverParameter(), ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER);
|
||||
//PropertyGetterDescriptor getter = DescriptorResolver.createDefaultGetter(propertyDescriptor);
|
||||
//getter.initialize(propertyDescriptor.getType());
|
||||
propertyDescriptor.initialize(null, null);
|
||||
classScope.addPropertyDescriptor(propertyDescriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ClassDescriptor getClassDescriptor() {
|
||||
return classDescriptor;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user