Support parameter annotations. Fix class path and test data
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public trait LoadIterable<T> : java.lang.Object {
|
import org.jetbrains.annotations.*
|
||||||
public fun getIterable(): MutableIterable<T>?
|
|
||||||
public fun setIterable(p0: MutableIterable<T>?)
|
|
||||||
|
|
||||||
|
public trait LoadIterable<T> : java.lang.Object {
|
||||||
|
Mutable
|
||||||
|
public fun getIterable(): MutableIterable<T>?
|
||||||
|
public fun setIterable([Mutable] p0: MutableIterable<T>?)
|
||||||
|
|
||||||
|
ReadOnly
|
||||||
public fun getReadOnlyIterable(): Iterable<T>?
|
public fun getReadOnlyIterable(): Iterable<T>?
|
||||||
public fun setReadOnlyIterable(p0: Iterable<T>?)
|
public fun setReadOnlyIterable([ReadOnly] p0: Iterable<T>?)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public trait LoadIterable</*0*/ T> : java.lang.Object {
|
public trait LoadIterable</*0*/ T> : java.lang.Object {
|
||||||
public abstract fun getIterable(): jet.MutableIterable<T>?
|
org.jetbrains.annotations.Mutable() public abstract fun getIterable(): jet.MutableIterable<T>?
|
||||||
public abstract fun getReadOnlyIterable(): jet.Iterable<T>?
|
org.jetbrains.annotations.ReadOnly() public abstract fun getReadOnlyIterable(): jet.Iterable<T>?
|
||||||
public abstract fun setIterable(/*0*/ p0: jet.MutableIterable<T>?): jet.Unit
|
public abstract fun setIterable(/*0*/ org.jetbrains.annotations.Mutable() p0: jet.MutableIterable<T>?): jet.Unit
|
||||||
public abstract fun setReadOnlyIterable(/*0*/ p0: jet.Iterable<T>?): jet.Unit
|
public abstract fun setReadOnlyIterable(/*0*/ org.jetbrains.annotations.ReadOnly() p0: jet.Iterable<T>?): jet.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-1
@@ -1,6 +1,9 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.*
|
||||||
|
|
||||||
public trait LoadIterableWithConflict<T> : java.lang.Object {
|
public trait LoadIterableWithConflict<T> : java.lang.Object {
|
||||||
|
[ReadOnly] [Mutable]
|
||||||
public fun getIterable(): MutableIterable<T>?
|
public fun getIterable(): MutableIterable<T>?
|
||||||
public fun setIterable(p0: MutableIterable<T>?)
|
public fun setIterable([ReadOnly] [Mutable] p0: MutableIterable<T>?)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public trait LoadIterableWithConflict</*0*/ T> : java.lang.Object {
|
public trait LoadIterableWithConflict</*0*/ T> : java.lang.Object {
|
||||||
public abstract fun getIterable(): jet.MutableIterable<T>?
|
org.jetbrains.annotations.ReadOnly() org.jetbrains.annotations.Mutable() public abstract fun getIterable(): jet.MutableIterable<T>?
|
||||||
public abstract fun setIterable(/*0*/ p0: jet.MutableIterable<T>?): jet.Unit
|
public abstract fun setIterable(/*0*/ org.jetbrains.annotations.ReadOnly() org.jetbrains.annotations.Mutable() p0: jet.MutableIterable<T>?): jet.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-4
@@ -1,9 +1,13 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public trait LoadIterableWithNullability<T> : java.lang.Object {
|
import org.jetbrains.annotations.*
|
||||||
public fun getIterable(): MutableIterable<T>
|
|
||||||
public fun setIterable(p0: MutableIterable<T>)
|
|
||||||
|
|
||||||
|
public trait LoadIterableWithNullability<T> : java.lang.Object {
|
||||||
|
Mutable
|
||||||
|
public fun getIterable(): MutableIterable<T>
|
||||||
|
public fun setIterable([Mutable] p0: MutableIterable<T>)
|
||||||
|
|
||||||
|
ReadOnly
|
||||||
public fun getReadOnlyIterable(): Iterable<T>
|
public fun getReadOnlyIterable(): Iterable<T>
|
||||||
public fun setReadOnlyIterable(p0: Iterable<T>)
|
public fun setReadOnlyIterable([ReadOnly] p0: Iterable<T>)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public trait LoadIterableWithNullability</*0*/ T> : java.lang.Object {
|
public trait LoadIterableWithNullability</*0*/ T> : java.lang.Object {
|
||||||
public abstract fun getIterable(): jet.MutableIterable<T>
|
org.jetbrains.annotations.Mutable() public abstract fun getIterable(): jet.MutableIterable<T>
|
||||||
public abstract fun getReadOnlyIterable(): jet.Iterable<T>
|
org.jetbrains.annotations.ReadOnly() public abstract fun getReadOnlyIterable(): jet.Iterable<T>
|
||||||
public abstract fun setIterable(/*0*/ p0: jet.MutableIterable<T>): jet.Unit
|
public abstract fun setIterable(/*0*/ org.jetbrains.annotations.Mutable() p0: jet.MutableIterable<T>): jet.Unit
|
||||||
public abstract fun setReadOnlyIterable(/*0*/ p0: jet.Iterable<T>): jet.Unit
|
public abstract fun setReadOnlyIterable(/*0*/ org.jetbrains.annotations.ReadOnly() p0: jet.Iterable<T>): jet.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -1,14 +1,17 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
import org.jetbrains.annotations.*
|
||||||
|
|
||||||
public trait LoadIterableWithPropagation: java.lang.Object {
|
public trait LoadIterableWithPropagation: java.lang.Object {
|
||||||
public trait LoadIterable<T> : java.lang.Object {
|
public trait LoadIterable<T> : java.lang.Object {
|
||||||
|
Mutable
|
||||||
public fun getIterable(): MutableIterable<T>?
|
public fun getIterable(): MutableIterable<T>?
|
||||||
public fun setIterable(p0: MutableIterable<T>?)
|
public fun setIterable([Mutable] p0: MutableIterable<T>?)
|
||||||
|
|
||||||
|
ReadOnly
|
||||||
public fun getReadOnlyIterable(): Iterable<T>?
|
public fun getReadOnlyIterable(): Iterable<T>?
|
||||||
public fun setReadOnlyIterable(p0: Iterable<T>?)
|
public fun setReadOnlyIterable([ReadOnly] p0: Iterable<T>?)
|
||||||
}
|
}
|
||||||
|
|
||||||
public open class LoadIterableImpl<T> : LoadIterable<T> {
|
public open class LoadIterableImpl<T> : LoadIterable<T> {
|
||||||
|
|||||||
+4
-4
@@ -3,10 +3,10 @@ package test
|
|||||||
public trait LoadIterableWithPropagation : java.lang.Object {
|
public trait LoadIterableWithPropagation : java.lang.Object {
|
||||||
|
|
||||||
public trait LoadIterable</*0*/ T> : java.lang.Object {
|
public trait LoadIterable</*0*/ T> : java.lang.Object {
|
||||||
public abstract fun getIterable(): jet.MutableIterable<T>?
|
org.jetbrains.annotations.Mutable() public abstract fun getIterable(): jet.MutableIterable<T>?
|
||||||
public abstract fun getReadOnlyIterable(): jet.Iterable<T>?
|
org.jetbrains.annotations.ReadOnly() public abstract fun getReadOnlyIterable(): jet.Iterable<T>?
|
||||||
public abstract fun setIterable(/*0*/ p0: jet.MutableIterable<T>?): jet.Unit
|
public abstract fun setIterable(/*0*/ org.jetbrains.annotations.Mutable() p0: jet.MutableIterable<T>?): jet.Unit
|
||||||
public abstract fun setReadOnlyIterable(/*0*/ p0: jet.Iterable<T>?): jet.Unit
|
public abstract fun setReadOnlyIterable(/*0*/ org.jetbrains.annotations.ReadOnly() p0: jet.Iterable<T>?): jet.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
public open class LoadIterableImpl</*0*/ T> : test.LoadIterableWithPropagation.LoadIterable<T> {
|
public open class LoadIterableImpl</*0*/ T> : test.LoadIterableWithPropagation.LoadIterable<T> {
|
||||||
|
|||||||
@@ -243,7 +243,7 @@ public class JetTestUtils {
|
|||||||
@NotNull TestJdkKind jdkKind
|
@NotNull TestJdkKind jdkKind
|
||||||
) {
|
) {
|
||||||
return JetCoreEnvironment.createForTests(disposable, compilerConfigurationForTests(
|
return JetCoreEnvironment.createForTests(disposable, compilerConfigurationForTests(
|
||||||
configurationKind, jdkKind, getAnnotationsJar(), getAnnotationsExtJar()));
|
configurationKind, jdkKind, getAnnotationsJar()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File findMockJdkRtJar() {
|
public static File findMockJdkRtJar() {
|
||||||
@@ -254,10 +254,6 @@ public class JetTestUtils {
|
|||||||
return new File(JetTestCaseBuilder.getHomeDirectory(), "compiler/testData/mockJDK/jre/lib/annotations.jar");
|
return new File(JetTestCaseBuilder.getHomeDirectory(), "compiler/testData/mockJDK/jre/lib/annotations.jar");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File getAnnotationsExtJar() {
|
|
||||||
return new File(JetTestCaseBuilder.getHomeDirectory(), "dist/kotlinc/lib/kotlin-annotations-ext.jar");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void mkdirs(File file) throws IOException {
|
public static void mkdirs(File file) throws IOException {
|
||||||
if (file.isDirectory()) {
|
if (file.isDirectory()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ public final class LoadDescriptorUtil {
|
|||||||
@NotNull ConfigurationKind configurationKind
|
@NotNull ConfigurationKind configurationKind
|
||||||
) {
|
) {
|
||||||
CompilerConfiguration configuration = JetTestUtils.compilerConfigurationForTests(
|
CompilerConfiguration configuration = JetTestUtils.compilerConfigurationForTests(
|
||||||
configurationKind, TestJdkKind.MOCK_JDK, JetTestUtils.getAnnotationsJar(),
|
configurationKind, TestJdkKind.MOCK_JDK,
|
||||||
|
JetTestUtils.getAnnotationsJar(),
|
||||||
javaRoot,
|
javaRoot,
|
||||||
new File("compiler/tests") // for @ExpectLoadError annotation
|
new File("compiler/tests") // for @ExpectLoadError annotation
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-3
@@ -19,7 +19,6 @@ package org.jetbrains.jet.lang.resolve.java.resolver;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||||
import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl;
|
import org.jetbrains.jet.lang.descriptors.impl.ValueParameterDescriptorImpl;
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaArrayType;
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaArrayType;
|
||||||
import org.jetbrains.jet.lang.resolve.java.structure.JavaMethod;
|
import org.jetbrains.jet.lang.resolve.java.structure.JavaMethod;
|
||||||
@@ -32,7 +31,6 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public final class JavaValueParameterResolver {
|
public final class JavaValueParameterResolver {
|
||||||
@@ -85,7 +83,7 @@ public final class JavaValueParameterResolver {
|
|||||||
return new ValueParameterDescriptorImpl(
|
return new ValueParameterDescriptorImpl(
|
||||||
containingDeclaration,
|
containingDeclaration,
|
||||||
i,
|
i,
|
||||||
Collections.<AnnotationDescriptor>emptyList(), // TODO
|
annotationResolver.resolveAnnotations(parameter),
|
||||||
getParameterName(i, parameter), // TODO: must be very slow, make it lazy?
|
getParameterName(i, parameter), // TODO: must be very slow, make it lazy?
|
||||||
outType,
|
outType,
|
||||||
false,
|
false,
|
||||||
|
|||||||
Reference in New Issue
Block a user