Minor, get rid of SAMs in some loadJava tests
This commit is contained in:
@@ -3,12 +3,12 @@ package test;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
public class InnerOfGeneric {
|
public class InnerOfGeneric {
|
||||||
public interface S<E> {
|
public class S<E> {
|
||||||
Iterator<E> iterator();
|
public Iterator<E> iterator() { return null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class A<K> {
|
public abstract class A<K> {
|
||||||
public abstract class Inner implements S<K> {
|
public abstract class Inner extends S<K> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ public open class InnerOfGeneric {
|
|||||||
|
|
||||||
public abstract inner class Inner : test.InnerOfGeneric.S<K!> {
|
public abstract inner class Inner : test.InnerOfGeneric.S<K!> {
|
||||||
public constructor Inner()
|
public constructor Inner()
|
||||||
public abstract override /*1*/ /*fake_override*/ fun iterator(): kotlin.(Mutable)Iterator<K!>!
|
public open override /*1*/ /*fake_override*/ fun iterator(): kotlin.(Mutable)Iterator<K!>!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,10 +21,8 @@ public open class InnerOfGeneric {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public trait S</*0*/ E> {
|
public open inner class S</*0*/ E> {
|
||||||
public abstract fun iterator(): kotlin.(Mutable)Iterator<E!>!
|
public constructor S</*0*/ E>()
|
||||||
|
public open fun iterator(): kotlin.(Mutable)Iterator<E!>!
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static members
|
|
||||||
public final /*synthesized*/ fun </*0*/ E> S(/*0*/ function: () -> kotlin.(Mutable)Iterator<E!>!): test.InnerOfGeneric.S<E>
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,19 +10,12 @@ public class PrivateMembers {
|
|||||||
private void method() {
|
private void method() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void samAdapter(SamInterface r) {
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void staticMethod() {
|
private static void staticMethod() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private class Inner {
|
private class Inner {
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface SamInterface {
|
|
||||||
void foo();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class Nested {
|
private static class Nested {
|
||||||
private static void staticMethodInNested() {
|
private static void staticMethodInNested() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,6 @@ public open class PrivateMembers {
|
|||||||
private constructor PrivateMembers()
|
private constructor PrivateMembers()
|
||||||
private final var field: kotlin.Int
|
private final var field: kotlin.Int
|
||||||
private open fun method(): kotlin.Unit
|
private open fun method(): kotlin.Unit
|
||||||
private final /*synthesized*/ fun samAdapter(/*0*/ p0: (() -> kotlin.Unit)!): kotlin.Unit
|
|
||||||
private open fun samAdapter(/*0*/ p0: test.PrivateMembers.SamInterface!): kotlin.Unit
|
|
||||||
|
|
||||||
private open inner class Inner {
|
private open inner class Inner {
|
||||||
private constructor Inner()
|
private constructor Inner()
|
||||||
@@ -18,12 +16,7 @@ public open class PrivateMembers {
|
|||||||
private open fun staticMethodInNested(): kotlin.Unit
|
private open fun staticMethodInNested(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
private trait SamInterface {
|
|
||||||
public abstract fun foo(): kotlin.Unit
|
|
||||||
}
|
|
||||||
|
|
||||||
// Static members
|
// Static members
|
||||||
private final var staticField: kotlin.Int
|
private final var staticField: kotlin.Int
|
||||||
private final /*synthesized*/ fun SamInterface(/*0*/ function: () -> kotlin.Unit): test.PrivateMembers.SamInterface
|
|
||||||
private open fun staticMethod(): kotlin.Unit
|
private open fun staticMethod(): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package test;
|
package test;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface RawTypeWithUpperBound {
|
public interface RawTypeWithUpperBound {
|
||||||
|
|
||||||
public interface Foo<T extends CharSequence> {
|
public interface Foo<T extends CharSequence> {
|
||||||
@@ -7,5 +9,6 @@ public interface RawTypeWithUpperBound {
|
|||||||
|
|
||||||
interface Bar {
|
interface Bar {
|
||||||
void f(Foo f);
|
void f(Foo f);
|
||||||
|
void g(List<Foo> f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,11 +4,9 @@ public trait RawTypeWithUpperBound {
|
|||||||
|
|
||||||
public trait Bar {
|
public trait Bar {
|
||||||
public abstract fun f(/*0*/ p0: test.RawTypeWithUpperBound.Foo<out kotlin.CharSequence!>!): kotlin.Unit
|
public abstract fun f(/*0*/ p0: test.RawTypeWithUpperBound.Foo<out kotlin.CharSequence!>!): kotlin.Unit
|
||||||
|
public abstract fun g(/*0*/ p0: kotlin.(Mutable)List<test.RawTypeWithUpperBound.Foo<out kotlin.CharSequence!>!>!): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
public trait Foo</*0*/ T : kotlin.CharSequence!> {
|
public trait Foo</*0*/ T : kotlin.CharSequence!> {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static members
|
|
||||||
public final /*synthesized*/ fun Bar(/*0*/ function: (test.RawTypeWithUpperBound.Foo<out kotlin.CharSequence!>!) -> kotlin.Unit): test.RawTypeWithUpperBound.Bar
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package test;
|
||||||
|
|
||||||
|
public class PrivateSamAdapter {
|
||||||
|
private void samAdapter(SamInterface r) {
|
||||||
|
}
|
||||||
|
|
||||||
|
private interface SamInterface {
|
||||||
|
void foo();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
public open class PrivateSamAdapter {
|
||||||
|
public constructor PrivateSamAdapter()
|
||||||
|
private final /*synthesized*/ fun samAdapter(/*0*/ p0: (() -> kotlin.Unit)!): kotlin.Unit
|
||||||
|
private open fun samAdapter(/*0*/ p0: test.PrivateSamAdapter.SamInterface!): kotlin.Unit
|
||||||
|
|
||||||
|
private trait SamInterface {
|
||||||
|
public abstract fun foo(): kotlin.Unit
|
||||||
|
}
|
||||||
|
|
||||||
|
// Static members
|
||||||
|
private final /*synthesized*/ fun SamInterface(/*0*/ function: () -> kotlin.Unit): test.PrivateSamAdapter.SamInterface
|
||||||
|
}
|
||||||
@@ -8,6 +8,8 @@ public class RawSuperType {
|
|||||||
|
|
||||||
public interface Super<T> {
|
public interface Super<T> {
|
||||||
void foo(T t);
|
void foo(T t);
|
||||||
|
|
||||||
|
void dummy(); // To make it not SAM
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Derived implements Super {
|
public class Derived implements Super {
|
||||||
@@ -15,6 +17,9 @@ public class RawSuperType {
|
|||||||
public void foo(Object o) {
|
public void foo(Object o) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void dummy() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -5,13 +5,12 @@ public open class RawSuperType {
|
|||||||
|
|
||||||
public open inner class Derived : test.RawSuperType.Super<kotlin.Any?> {
|
public open inner class Derived : test.RawSuperType.Super<kotlin.Any?> {
|
||||||
public constructor Derived()
|
public constructor Derived()
|
||||||
|
public open override /*1*/ fun dummy(): kotlin.Unit
|
||||||
public open override /*1*/ fun foo(/*0*/ p0: kotlin.Any!): kotlin.Unit
|
public open override /*1*/ fun foo(/*0*/ p0: kotlin.Any!): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
public trait Super</*0*/ T> {
|
public trait Super</*0*/ T> {
|
||||||
|
public abstract fun dummy(): kotlin.Unit
|
||||||
public abstract fun foo(/*0*/ p0: T!): kotlin.Unit
|
public abstract fun foo(/*0*/ p0: T!): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static members
|
|
||||||
public final /*synthesized*/ fun </*0*/ T> Super(/*0*/ function: (T!) -> kotlin.Unit): test.RawSuperType.Super<T>
|
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-1
@@ -10,9 +10,13 @@ public interface TwoSuperclassesInconsistentGenericTypes {
|
|||||||
@KotlinSignature("fun foo(): MutableList<String?>")
|
@KotlinSignature("fun foo(): MutableList<String?>")
|
||||||
List<String> foo();
|
List<String> foo();
|
||||||
|
|
||||||
|
void dummy(); // To make it not SAM
|
||||||
|
|
||||||
public interface Other {
|
public interface Other {
|
||||||
@KotlinSignature("fun foo(): MutableList<String>?")
|
@KotlinSignature("fun foo(): MutableList<String>?")
|
||||||
List<String> foo();
|
List<String> foo();
|
||||||
|
|
||||||
|
void dummy(); // To make it not SAM
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Sub implements TwoSuperclassesInconsistentGenericTypes, Other {
|
public class Sub implements TwoSuperclassesInconsistentGenericTypes, Other {
|
||||||
@@ -20,5 +24,7 @@ public interface TwoSuperclassesInconsistentGenericTypes {
|
|||||||
public List<String> foo() {
|
public List<String> foo() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void dummy() {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -1,19 +1,17 @@
|
|||||||
package test
|
package test
|
||||||
|
|
||||||
public /*synthesized*/ fun TwoSuperclassesInconsistentGenericTypes(/*0*/ function: () -> kotlin.(Mutable)List<kotlin.String!>!): test.TwoSuperclassesInconsistentGenericTypes
|
|
||||||
|
|
||||||
public trait TwoSuperclassesInconsistentGenericTypes {
|
public trait TwoSuperclassesInconsistentGenericTypes {
|
||||||
|
public abstract fun dummy(): kotlin.Unit
|
||||||
public abstract fun foo(): kotlin.(Mutable)List<kotlin.String!>!
|
public abstract fun foo(): kotlin.(Mutable)List<kotlin.String!>!
|
||||||
|
|
||||||
public trait Other {
|
public trait Other {
|
||||||
|
public abstract fun dummy(): kotlin.Unit
|
||||||
public abstract fun foo(): kotlin.(Mutable)List<kotlin.String!>!
|
public abstract fun foo(): kotlin.(Mutable)List<kotlin.String!>!
|
||||||
}
|
}
|
||||||
|
|
||||||
public open class Sub : test.TwoSuperclassesInconsistentGenericTypes, test.TwoSuperclassesInconsistentGenericTypes.Other {
|
public open class Sub : test.TwoSuperclassesInconsistentGenericTypes, test.TwoSuperclassesInconsistentGenericTypes.Other {
|
||||||
public constructor Sub()
|
public constructor Sub()
|
||||||
|
public open override /*2*/ fun dummy(): kotlin.Unit
|
||||||
public open override /*2*/ fun foo(): kotlin.(Mutable)List<kotlin.String!>!
|
public open override /*2*/ fun foo(): kotlin.(Mutable)List<kotlin.String!>!
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static members
|
|
||||||
public final /*synthesized*/ fun Other(/*0*/ function: () -> kotlin.(Mutable)List<kotlin.String!>!): test.TwoSuperclassesInconsistentGenericTypes.Other
|
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -11,11 +11,15 @@ import org.jetbrains.jet.jvm.compiler.annotation.ExpectLoadError;
|
|||||||
public interface TwoSuperclassesVarargAndNot {
|
public interface TwoSuperclassesVarargAndNot {
|
||||||
public interface Super1 {
|
public interface Super1 {
|
||||||
void foo(String... s);
|
void foo(String... s);
|
||||||
|
|
||||||
|
void dummy(); // To make it not SAM
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Super2 {
|
public interface Super2 {
|
||||||
@KotlinSignature("fun foo(s : Array<out String?>?)")
|
@KotlinSignature("fun foo(s : Array<out String?>?)")
|
||||||
void foo(String[] s);
|
void foo(String[] s);
|
||||||
|
|
||||||
|
void dummy(); // To make it not SAM
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface Sub extends Super1, Super2 {
|
public interface Sub extends Super1, Super2 {
|
||||||
@@ -24,4 +28,4 @@ public interface TwoSuperclassesVarargAndNot {
|
|||||||
"Incompatible super methods: some have vararg parameter, some have not|")
|
"Incompatible super methods: some have vararg parameter, some have not|")
|
||||||
void foo(String[] s);
|
void foo(String[] s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-4
@@ -3,18 +3,17 @@ package test
|
|||||||
public trait TwoSuperclassesVarargAndNot {
|
public trait TwoSuperclassesVarargAndNot {
|
||||||
|
|
||||||
public trait Sub : test.TwoSuperclassesVarargAndNot.Super1, test.TwoSuperclassesVarargAndNot.Super2 {
|
public trait Sub : test.TwoSuperclassesVarargAndNot.Super1, test.TwoSuperclassesVarargAndNot.Super2 {
|
||||||
|
public abstract override /*2*/ /*fake_override*/ fun dummy(): kotlin.Unit
|
||||||
public abstract override /*2*/ fun foo(/*0*/ s: kotlin.Array<(out) kotlin.String!>!): kotlin.Unit
|
public abstract override /*2*/ fun foo(/*0*/ s: kotlin.Array<(out) kotlin.String!>!): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
public trait Super1 {
|
public trait Super1 {
|
||||||
|
public abstract fun dummy(): kotlin.Unit
|
||||||
public abstract fun foo(/*0*/ vararg p0: kotlin.String! /*kotlin.Array<(out) kotlin.String!>!*/): kotlin.Unit
|
public abstract fun foo(/*0*/ vararg p0: kotlin.String! /*kotlin.Array<(out) kotlin.String!>!*/): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
public trait Super2 {
|
public trait Super2 {
|
||||||
|
public abstract fun dummy(): kotlin.Unit
|
||||||
public abstract fun foo(/*0*/ s: kotlin.Array<(out) kotlin.String!>!): kotlin.Unit
|
public abstract fun foo(/*0*/ s: kotlin.Array<(out) kotlin.String!>!): kotlin.Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static members
|
|
||||||
public final /*synthesized*/ fun Super1(/*0*/ function: (kotlin.Array<(out) kotlin.String!>!) -> kotlin.Unit): test.TwoSuperclassesVarargAndNot.Super1
|
|
||||||
public final /*synthesized*/ fun Super2(/*0*/ function: (kotlin.Array<(out) kotlin.String!>!) -> kotlin.Unit): test.TwoSuperclassesVarargAndNot.Super2
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1524,6 +1524,12 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
|||||||
doTestCompiledJava(fileName);
|
doTestCompiledJava(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PrivateSamAdapter.java")
|
||||||
|
public void testPrivateSamAdapter() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/PrivateSamAdapter.java");
|
||||||
|
doTestCompiledJava(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("SelfAsParameter.java")
|
@TestMetadata("SelfAsParameter.java")
|
||||||
public void testSelfAsParameter() throws Exception {
|
public void testSelfAsParameter() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.java");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/adapters/SelfAsParameter.java");
|
||||||
|
|||||||
Reference in New Issue
Block a user