mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
compiler testdata: s/trait/interface
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
trait TheTrait {
|
||||
interface TheTrait {
|
||||
companion object {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package test
|
||||
|
||||
public class InheritMethodsDifferentReturnTypes {
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): CharSequence?
|
||||
public fun bar(): String?
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): String?
|
||||
public fun bar(): CharSequence?
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package test
|
||||
|
||||
public class InheritMethodsDifferentReturnTypesGeneric {
|
||||
public trait Super1<F, B> {
|
||||
public interface Super1<F, B> {
|
||||
public fun foo(): F?
|
||||
public fun bar(): B?
|
||||
}
|
||||
|
||||
public trait Super2<FF, BB> {
|
||||
public interface Super2<FF, BB> {
|
||||
public fun foo(): FF?
|
||||
public fun bar(): BB?
|
||||
}
|
||||
|
||||
public trait Sub: Super1<String, CharSequence>, Super2<CharSequence, String> {
|
||||
public interface Sub: Super1<String, CharSequence>, Super2<CharSequence, String> {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
public trait RemoveRedundantProjectionKind {
|
||||
public interface RemoveRedundantProjectionKind {
|
||||
public fun f(p0: Collection<CharSequence?>?)
|
||||
public fun f(p0: Comparable<CharSequence?>?)
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ package test
|
||||
public final class UnboundWildcard {
|
||||
public final fun foo(): MyClass<*>? = throw UnsupportedOperationException()
|
||||
|
||||
public trait MyClass<T: CharSequence?>
|
||||
public interface MyClass<T: CharSequence?>
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ package test
|
||||
public final class StarProjection {
|
||||
public final fun foo(): MyClass<*> = throw UnsupportedOperationException()
|
||||
|
||||
public trait MyClass<T: CharSequence?>
|
||||
public interface MyClass<T: CharSequence?>
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package test
|
||||
|
||||
public trait PropagateTypeArgumentNullable {
|
||||
public interface PropagateTypeArgumentNullable {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun outS(p: List<String?>)
|
||||
|
||||
public fun invOutS(p : MutableList<List<String?>>)
|
||||
@@ -15,7 +15,7 @@ public trait PropagateTypeArgumentNullable {
|
||||
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun outS(p: List<String?>)
|
||||
|
||||
override fun invOutS(p : MutableList<List<String?>>)
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait ChangeProjectionKind1 {
|
||||
public interface ChangeProjectionKind1 {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: MutableList<in String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: MutableList<in String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait ChangeProjectionKind2 {
|
||||
public interface ChangeProjectionKind2 {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: MutableList<String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: MutableList<String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter {
|
||||
public interface DeeplySubstitutedClassParameter {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(t: T)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
public interface Middle<E>: Super<E> {
|
||||
override fun foo(t: E)
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
public interface Sub: Middle<String> {
|
||||
override fun foo(t: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter2 {
|
||||
public interface DeeplySubstitutedClassParameter2 {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(t: T)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
public interface Middle<E>: Super<E> {
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
public interface Sub: Middle<String> {
|
||||
override fun foo(t: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritMutability {
|
||||
public interface InheritMutability {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: MutableList<String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: MutableList<String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait InheritNotVararg {
|
||||
public interface InheritNotVararg {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p0: Array<out String>?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p0: Array<out String>?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait InheritNotVarargInteger {
|
||||
public interface InheritNotVarargInteger {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p0: Array<out Int>?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p0: Array<out Int>?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait InheritNotVarargNotNull {
|
||||
public interface InheritNotVarargNotNull {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: Array<out String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: Array<out String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritNotVarargPrimitive {
|
||||
public interface InheritNotVarargPrimitive {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p0: IntArray?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p0: IntArray?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullability {
|
||||
public interface InheritNullability {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p0: String)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait InheritProjectionKind {
|
||||
public interface InheritProjectionKind {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: MutableList<in String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: MutableList<in String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnliness {
|
||||
public interface InheritReadOnliness {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: List<String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: List<String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritVararg {
|
||||
public interface InheritVararg {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(vararg p0: String?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(vararg p0: String?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritVarargInteger {
|
||||
public interface InheritVarargInteger {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(vararg p0: Int?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(vararg p0: Int?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait InheritVarargNotNull {
|
||||
public interface InheritVarargNotNull {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(vararg p: String)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(vararg p: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritVarargPrimitive {
|
||||
public interface InheritVarargPrimitive {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(vararg p0: Int)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(vararg p0: Int)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
// See SubclassFromGenericAndNot, as well
|
||||
public trait Kt3302 {
|
||||
public trait BSONObject {
|
||||
public interface Kt3302 {
|
||||
public interface BSONObject {
|
||||
public fun put(p0: String, p1: Any): Any?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait LinkedHashMap<K, V> {
|
||||
public interface LinkedHashMap<K, V> {
|
||||
public fun put(key: K, value: V): V?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait BasicBSONObject : LinkedHashMap<String, Any>, BSONObject {
|
||||
public interface BasicBSONObject : LinkedHashMap<String, Any>, BSONObject {
|
||||
override fun put(key: String, value: Any): Any?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait MutableToReadOnly {
|
||||
public interface MutableToReadOnly {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: MutableList<String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: MutableList<String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait NotNullToNullable {
|
||||
public interface NotNullToNullable {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p0: String)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p0: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait NullableToNotNull {
|
||||
public interface NullableToNotNull {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p0: String?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p0: String?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait NullableToNotNullKotlinSignature {
|
||||
public interface NullableToNotNullKotlinSignature {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: String?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: String?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait OverrideWithErasedParameter {
|
||||
public interface OverrideWithErasedParameter {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(p0: T?)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub<T>: Super<T> {
|
||||
public interface Sub<T>: Super<T> {
|
||||
override fun foo(p0: T?)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait ReadOnlyToMutable {
|
||||
public interface ReadOnlyToMutable {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(p: List<String>)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(p: List<String>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package test
|
||||
|
||||
// Extracted from KT-3302, see Kt3302 test, as well
|
||||
public trait SubclassFromGenericAndNot {
|
||||
public interface SubclassFromGenericAndNot {
|
||||
|
||||
public trait NonGeneric {
|
||||
public interface NonGeneric {
|
||||
public fun foo(p0: String)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Generic<T> {
|
||||
public interface Generic<T> {
|
||||
public fun foo(key: T)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub : NonGeneric, Generic<String> {
|
||||
public interface Sub : NonGeneric, Generic<String> {
|
||||
override fun foo(key: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameter {
|
||||
public interface SubstitutedClassParameter {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(t: T)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super<String> {
|
||||
public interface Sub: Super<String> {
|
||||
override fun foo(t: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameters {
|
||||
public interface SubstitutedClassParameters {
|
||||
|
||||
public trait Super1<T> {
|
||||
public interface Super1<T> {
|
||||
public fun foo(t: T)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2<E> {
|
||||
public interface Super2<E> {
|
||||
public fun foo(t: E)
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1<String>, Super2<String> {
|
||||
public interface Sub: Super1<String>, Super2<String> {
|
||||
override fun foo(t: String)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait AddNotNullJavaSubtype {
|
||||
public interface AddNotNullJavaSubtype {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): CharSequence?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait AddNotNullSameJavaType {
|
||||
public interface AddNotNullSameJavaType {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): CharSequence?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): CharSequence
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait AddNullabilityJavaSubtype {
|
||||
public interface AddNullabilityJavaSubtype {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): CharSequence
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait AddNullabilitySameGenericType1 {
|
||||
public interface AddNullabilitySameGenericType1 {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableList<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait AddNullabilitySameGenericType2 {
|
||||
public interface AddNullabilitySameGenericType2 {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableList<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait AddNullabilitySameJavaType {
|
||||
public interface AddNullabilitySameJavaType {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): CharSequence
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): CharSequence
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait CantMakeImmutableInSubclass {
|
||||
public interface CantMakeImmutableInSubclass {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableCollection<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter {
|
||||
public interface DeeplySubstitutedClassParameter {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
public interface Middle<E>: Super<E> {
|
||||
override fun foo(): E
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
public interface Sub: Middle<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package test
|
||||
|
||||
public trait DeeplySubstitutedClassParameter2 {
|
||||
public interface DeeplySubstitutedClassParameter2 {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Middle<E>: Super<E> {
|
||||
public interface Middle<E>: Super<E> {
|
||||
}
|
||||
|
||||
public trait Sub: Middle<String> {
|
||||
public interface Sub: Middle<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait HalfSubstitutedTypeParameters {
|
||||
public interface HalfSubstitutedTypeParameters {
|
||||
|
||||
public trait TrickyList<X, E>: MutableList<E> {}
|
||||
public interface TrickyList<X, E>: MutableList<E> {}
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableList<String?>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): TrickyList<Int, String?>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullabilityGenericSubclassSimple {
|
||||
public interface InheritNullabilityGenericSubclassSimple {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableCollection<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullabilityJavaSubtype {
|
||||
public interface InheritNullabilityJavaSubtype {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): CharSequence
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullabilitySameGenericType {
|
||||
public interface InheritNullabilitySameGenericType {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableList<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullabilitySameJavaType {
|
||||
public interface InheritNullabilitySameJavaType {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): CharSequence
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): CharSequence
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait InheritProjectionKind {
|
||||
public interface InheritProjectionKind {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableCollection<out Number>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableList<out Number>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnlinessOfArgument {
|
||||
public interface InheritReadOnlinessOfArgument {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): List<List<String>>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): List<List<String>>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnlinessSameClass {
|
||||
public interface InheritReadOnlinessSameClass {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): List<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): List<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnlinessSubclass {
|
||||
public interface InheritReadOnlinessSubclass {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): Collection<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): List<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait SameProjectionKind {
|
||||
public interface SameProjectionKind {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun foo(): MutableCollection<out Number?>?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun foo(): MutableCollection<out Number?>?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait SubclassFromGenericAndNot {
|
||||
public interface SubclassFromGenericAndNot {
|
||||
|
||||
public trait NonGeneric {
|
||||
public interface NonGeneric {
|
||||
public fun foo(): String?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Generic<T> {
|
||||
public interface Generic<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub : NonGeneric, Generic<String> {
|
||||
public interface Sub : NonGeneric, Generic<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public trait SubclassOfCollection<E>: MutableCollection<E> {
|
||||
public interface SubclassOfCollection<E>: MutableCollection<E> {
|
||||
override fun iterator() : MutableIterator<E>
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public trait SubclassOfMapEntry<K, V>: MutableMap.MutableEntry<K, V> {
|
||||
public interface SubclassOfMapEntry<K, V>: MutableMap.MutableEntry<K, V> {
|
||||
override fun setValue(value: V) : V
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameter {
|
||||
public interface SubstitutedClassParameter {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super<String> {
|
||||
public interface Sub: Super<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait SubstitutedClassParameters {
|
||||
public interface SubstitutedClassParameters {
|
||||
|
||||
public trait Super1<T> {
|
||||
public interface Super1<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2<E> {
|
||||
public interface Super2<E> {
|
||||
public fun foo(): E
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1<String>, Super2<String> {
|
||||
public interface Sub: Super1<String>, Super2<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
//ALLOW_AST_ACCESS
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesConflictingProjectionKinds {
|
||||
public interface TwoSuperclassesConflictingProjectionKinds {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): MutableCollection<CharSequence>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): MutableCollection<out CharSequence>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): MutableCollection<CharSequence>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesInvariantAndCovariantInferMutability {
|
||||
public interface TwoSuperclassesInvariantAndCovariantInferMutability {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): List<List<String>>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): MutableList<MutableList<String>>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): MutableList<MutableList<String>>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesInvariantAndCovariantInferNullability {
|
||||
public interface TwoSuperclassesInvariantAndCovariantInferNullability {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): List<String?>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): MutableList<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesMutableAndNot {
|
||||
public interface TwoSuperclassesMutableAndNot {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): MutableCollection<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): List<String>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): MutableList<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesReturnJavaSubtype {
|
||||
public interface TwoSuperclassesReturnJavaSubtype {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): CharSequence?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): CharSequence
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesReturnSameJavaType {
|
||||
public interface TwoSuperclassesReturnSameJavaType {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): CharSequence?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): CharSequence
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): CharSequence
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclassesSupplementNotNull {
|
||||
public interface TwoSuperclassesSupplementNotNull {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun foo(): List<String?>
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun foo(): List<String>?
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun foo(): List<String>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait TypeParamOfClass {
|
||||
public interface TypeParamOfClass {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub<T>: Super<T> {
|
||||
public interface Sub<T>: Super<T> {
|
||||
override fun foo(): T
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait TypeParamOfClassSubstituted {
|
||||
public interface TypeParamOfClassSubstituted {
|
||||
|
||||
public trait Super<T> {
|
||||
public interface Super<T> {
|
||||
public fun foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super<String> {
|
||||
public interface Sub: Super<String> {
|
||||
override fun foo(): String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package test
|
||||
|
||||
public trait TypeParamOfFun {
|
||||
public interface TypeParamOfFun {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <T> foo(): T
|
||||
|
||||
public fun dummy() // to avoid loading as SAM interface
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <E> foo(): E
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritMutability {
|
||||
public interface InheritMutability {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A: MutableList<String>> foo(a: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B: MutableList<String>> foo(a: B)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritNullability {
|
||||
public interface InheritNullability {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A: CharSequence> foo(a: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B: CharSequence> foo(a: B)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait InheritReadOnliness {
|
||||
public interface InheritReadOnliness {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A: List<String>> foo(a: A)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B: List<String>> foo(a: B)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TwoBounds {
|
||||
public interface TwoBounds {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A: CharSequence> foo(a: A) where A: Cloneable
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B: CharSequence> foo(a: B) where B: Cloneable
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
package test
|
||||
|
||||
public trait TwoSuperclasses {
|
||||
public interface TwoSuperclasses {
|
||||
|
||||
public trait Super1 {
|
||||
public interface Super1 {
|
||||
public fun <A: CharSequence> foo(a: A)
|
||||
}
|
||||
|
||||
public trait Super2 {
|
||||
public interface Super2 {
|
||||
public fun <B: CharSequence> foo(a: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super1, Super2 {
|
||||
public interface Sub: Super1, Super2 {
|
||||
override fun <C: CharSequence> foo(a: C)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait TwoTypeParameters {
|
||||
public interface TwoTypeParameters {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A: CharSequence, B: Cloneable> foo(a: A, b: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B: CharSequence, A: Cloneable> foo(a: B, b: A)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterAsUpperBound {
|
||||
public interface UseParameterAsUpperBound {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A, B: A> foo(a: A, b: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B, A: B> foo(a: B, b: A)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterInUpperBound {
|
||||
public interface UseParameterInUpperBound {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A, B: List<A>> foo(a: A, b: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B, A: List<B>> foo(a: B, b: A)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package test
|
||||
|
||||
public trait UseParameterInUpperBoundWithKotlinSignature {
|
||||
public interface UseParameterInUpperBoundWithKotlinSignature {
|
||||
|
||||
public trait Super {
|
||||
public interface Super {
|
||||
public fun <A, B: List<A>> foo(a: A, b: B)
|
||||
}
|
||||
|
||||
public trait Sub: Super {
|
||||
public interface Sub: Super {
|
||||
override fun <B, A: List<B>> foo(b: B, a: A)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
public trait LoadIterable<T> {
|
||||
public interface LoadIterable<T> {
|
||||
public fun getIterable(): MutableIterable<T>?
|
||||
public fun setIterable(p0: Iterable<T>?)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package test
|
||||
|
||||
public trait LoadIterator<T> {
|
||||
public interface LoadIterator<T> {
|
||||
public fun getIterator(): MutableIterator<T>?
|
||||
public fun setIterator(p0: Iterator<T>?)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user