Collections in interfaces marked @ReadOnly
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
<component name="libraryTable">
|
||||
<library name="kotlin-annotations-ext">
|
||||
<CLASSES>
|
||||
<root url="jar://$KOTLIN_BUNDLED$/lib/kotlin-annotations-ext.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
@@ -12,6 +12,7 @@
|
||||
<property name="bootstrap.home" value="dependencies/bootstrap-compiler"/>
|
||||
<property name="bootstrap.compiler.home" value="${bootstrap.home}/Kotlin/kotlinc"/>
|
||||
<property name="bootstrap.runtime" value="${bootstrap.compiler.home}/lib/kotlin-runtime.jar"/>
|
||||
<property name="bootstrap.annotations.ext" value="${bootstrap.compiler.home}/lib/kotlin-annotations-ext.jar"/>
|
||||
|
||||
<property name="output.relative" value="dist"/>
|
||||
<property name="output" value="${basedir}/${output.relative}"/>
|
||||
@@ -28,6 +29,7 @@
|
||||
|
||||
<path id="classpath">
|
||||
<file file="${bootstrap.runtime}"/>
|
||||
<file file="${bootstrap.annotations.ext}"/>
|
||||
<fileset dir="${idea.sdk}" includes="core/*.jar"/>
|
||||
<fileset dir="${idea.sdk}" includes="lib/protobuf-2.5.0.jar"/>
|
||||
|
||||
@@ -375,6 +377,7 @@
|
||||
|
||||
-libraryjars '${rtjar}'
|
||||
-libraryjars '${bootstrap.runtime}'
|
||||
-libraryjars '${bootstrap.annotations.ext}'
|
||||
|
||||
-target 1.6
|
||||
-dontoptimize
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="intellij-core" level="project" />
|
||||
<orderEntry type="module" module-name="util.runtime" />
|
||||
<orderEntry type="module" module-name="serialization" />
|
||||
<orderEntry type="library" name="kotlin-annotations-ext" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.jet.lang.descriptors;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeProjection;
|
||||
@@ -35,6 +36,7 @@ public interface ClassDescriptor extends ClassifierDescriptor, MemberDescriptor,
|
||||
JetScope getUnsubstitutedInnerClassesScope();
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<ConstructorDescriptor> getConstructors();
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,8 +16,11 @@
|
||||
|
||||
package org.jetbrains.jet.lang.descriptors.annotations;
|
||||
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface Annotated {
|
||||
@ReadOnly
|
||||
List<AnnotationDescriptor> getAnnotations();
|
||||
}
|
||||
|
||||
+2
@@ -18,6 +18,7 @@ package org.jetbrains.jet.lang.descriptors.impl;
|
||||
|
||||
import jet.Function0;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassifierDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptorVisitor;
|
||||
@@ -109,6 +110,7 @@ public abstract class AbstractLazyTypeParameterDescriptor implements TypeParamet
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
protected abstract Set<JetType> resolveUpperBounds();
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.jet.lang.resolve.scopes;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.resolve.name.LabelName;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
@@ -49,24 +50,28 @@ public interface JetScope {
|
||||
ClassDescriptor getObjectDescriptor(@NotNull Name name);
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<ClassDescriptor> getObjectDescriptors();
|
||||
|
||||
@Nullable
|
||||
NamespaceDescriptor getNamespace(@NotNull Name name);
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<VariableDescriptor> getProperties(@NotNull Name name);
|
||||
|
||||
@Nullable
|
||||
VariableDescriptor getLocalVariable(@NotNull Name name);
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<FunctionDescriptor> getFunctions(@NotNull Name name);
|
||||
|
||||
@NotNull
|
||||
DeclarationDescriptor getContainingDeclaration();
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<DeclarationDescriptor> getDeclarationsByLabel(@NotNull LabelName labelName);
|
||||
|
||||
/**
|
||||
@@ -75,14 +80,17 @@ public interface JetScope {
|
||||
* @return All visible descriptors from current scope.
|
||||
*/
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<DeclarationDescriptor> getAllDescriptors();
|
||||
|
||||
/**
|
||||
* Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
|
||||
*/
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy();
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<DeclarationDescriptor> getOwnDeclaredDescriptors();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.jet.lang.types;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.checker.JetTypeChecker;
|
||||
@@ -29,7 +30,9 @@ import java.util.List;
|
||||
public interface JetType extends Annotated {
|
||||
@NotNull TypeConstructor getConstructor();
|
||||
|
||||
@NotNull List<TypeProjection> getArguments();
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
List<TypeProjection> getArguments();
|
||||
|
||||
boolean isNullable();
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ package org.jetbrains.jet.lang.types;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.ReadOnly;
|
||||
import org.jetbrains.jet.lang.descriptors.ClassifierDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.annotations.Annotated;
|
||||
@@ -27,9 +28,11 @@ import java.util.List;
|
||||
|
||||
public interface TypeConstructor extends Annotated {
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
List<TypeParameterDescriptor> getParameters();
|
||||
|
||||
@NotNull
|
||||
@ReadOnly
|
||||
Collection<JetType> getSupertypes();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user