diff --git a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.java b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.java index 530133698c1..4dd6059f4df 100644 --- a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.java +++ b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.java @@ -2,6 +2,6 @@ package test; class GenericProperty { void foo() { - java.util.Map o = TestPackage.getTest(); + java.util.Map o = TestPackage.getTest(new java.util.HashMap()); } } diff --git a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.kt b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.kt index 6c2dde26791..e54b6940c74 100644 --- a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.kt +++ b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.kt @@ -2,5 +2,5 @@ package test // Tests that type variables of properties are written to the getter signature -val test: Map - get() = java.util.HashMap() +val Map.test: Map + get() = this as Map diff --git a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt index 1565b69f681..6b65b22227d 100644 --- a/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt +++ b/compiler/testData/compileJavaAgainstKotlin/property/GenericProperty.txt @@ -1,6 +1,6 @@ package test -public val test: kotlin.Map +public val kotlin.Map.test: kotlin.Map public/*package*/ open class GenericProperty { public/*package*/ constructor GenericProperty() diff --git a/compiler/testData/diagnostics/tests/CovariantOverrideType.kt b/compiler/testData/diagnostics/tests/CovariantOverrideType.kt index b3cfc4ff9be..ed3e349603c 100644 --- a/compiler/testData/diagnostics/tests/CovariantOverrideType.kt +++ b/compiler/testData/diagnostics/tests/CovariantOverrideType.kt @@ -1,16 +1,16 @@ -interface A { +interface A { fun foo() : Int = 1 fun foo2() : Int = 1 fun foo1() : Int = 1 val a : Int val a1 : Int - val g : Iterator + val g : Iterator fun g() : T fun g1() : T } -abstract class B() : A { +abstract class B() : A { override fun foo() { } override fun foo2() : Unit { @@ -22,5 +22,5 @@ abstract class B() : A { abstract override fun g() : Int abstract override fun g1() : List - abstract override val g : Iterator + abstract override val g : Iterator } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/CovariantOverrideType.txt b/compiler/testData/diagnostics/tests/CovariantOverrideType.txt index f26733c63cf..a7db6f5e8e8 100644 --- a/compiler/testData/diagnostics/tests/CovariantOverrideType.txt +++ b/compiler/testData/diagnostics/tests/CovariantOverrideType.txt @@ -1,9 +1,9 @@ package -public interface A { +public interface A { public abstract val a: kotlin.Int public abstract val a1: kotlin.Int - public abstract val g: kotlin.Iterator + public abstract val g: kotlin.Iterator public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open fun foo(): kotlin.Int public open fun foo1(): kotlin.Int @@ -14,11 +14,11 @@ public interface A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String } -public abstract class B : A { - public constructor B() +public abstract class B : A { + public constructor B() public open override /*1*/ val a: kotlin.Double = 1.0.toDouble() public open override /*1*/ val a1: kotlin.Double = 1.0.toDouble() - public abstract override /*1*/ val g: kotlin.Iterator + public abstract override /*1*/ val g: kotlin.Iterator public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ fun foo(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun foo1(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/MultipleBounds.kt b/compiler/testData/diagnostics/tests/MultipleBounds.kt index f7e40d83c73..a4ef617d631 100644 --- a/compiler/testData/diagnostics/tests/MultipleBounds.kt +++ b/compiler/testData/diagnostics/tests/MultipleBounds.kt @@ -9,9 +9,9 @@ interface B { } interface G { - val boo: Double where X : A, X : B - val bal: Double where A : B - val bas: Double where Y : B, X : B + val <X> boo: Double where X : A, X : B + val <A> bal: Double where A : B + val <Y> bas: Double where Y : B, X : B } class C() : A(), B @@ -66,4 +66,4 @@ val t1 = test2<A>(A()) val t2 = test2<B>(C()) val t3 = test2(C()) -val x : Int = 0 \ No newline at end of file +val <T, B : T> x : Int = 0 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.kt b/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.kt index a76a4739286..df4c0e3a99f 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.kt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.kt @@ -1,10 +1,10 @@ annotation class A1 annotation class A2(val some: Int = 12) -val <@A1 @A2(3) @A2 @A1(12) @A2("Test") T> topProp = 12 +val <@A1 @A2(3) @A2 @A1(12) @A2("Test") T> T.topProp: Int get() = 12 class SomeClass { - val <@A1 @A2(3) @A2 @A1(12) @A2("Test") T> field = 12 + val <@A1 @A2(3) @A2 @A1(12) @A2("Test") T> T.field: Int get() = 12 fun foo() { val <@A1 @A2(3) @A2 @A1(12) @A2("Test") T> localVal = 12 diff --git a/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.txt b/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.txt index d2748f06dc2..23daa6d70cc 100644 --- a/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.txt +++ b/compiler/testData/diagnostics/tests/annotations/AnnotationsForPropertyTypeParameter.txt @@ -1,6 +1,6 @@ package -public val topProp: kotlin.Int = 12 +public val T.topProp: kotlin.Int @kotlin.annotation.annotation() public final class A1 : kotlin.Annotation { public constructor A1() @@ -19,7 +19,7 @@ public val topProp: kotlin.Int = 12 public final class SomeClass { public constructor SomeClass() - public final val field: kotlin.Int = 12 + public final val T.field: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public final fun foo(): kotlin.Unit public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.kt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.kt index 55431d2d0f0..0bbc77f3ef1 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.kt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.kt @@ -1,15 +1,2 @@ -val <reified T> v: T +val <reified T> T.v: T get() = throw UnsupportedOperationException() - -fun id(p: T): T = p - -fun main() { - val a = v - - val b: A = v - - val c: Int = v - - // TODO svtk, uncomment when extensions are called for nested calls! - //val < !UNUSED_VARIABLE!>d< !>: A = id(< !TYPE_PARAMETER_AS_REIFIED!>v< !>) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.txt b/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.txt index d7e6d619087..1b7cfa58dc0 100644 --- a/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.txt +++ b/compiler/testData/diagnostics/tests/generics/tpAsReified/InProperty.txt @@ -1,5 +1,3 @@ package -public val v: T -public fun id(/*0*/ p: T): T -public fun main(): kotlin.Unit +public val T.v: T diff --git a/compiler/testData/diagnostics/tests/kt53.kt b/compiler/testData/diagnostics/tests/kt53.kt index 0c9da0867c0..6b31ad04a19 100644 --- a/compiler/testData/diagnostics/tests/kt53.kt +++ b/compiler/testData/diagnostics/tests/kt53.kt @@ -1,4 +1,4 @@ -val T.foo : E? +val T.foo : T? get() = null fun test(): Int? { diff --git a/compiler/testData/diagnostics/tests/kt53.txt b/compiler/testData/diagnostics/tests/kt53.txt index d08b3a4928a..b82081483ac 100644 --- a/compiler/testData/diagnostics/tests/kt53.txt +++ b/compiler/testData/diagnostics/tests/kt53.txt @@ -1,4 +1,4 @@ package -public val T.foo: E? +public val T.foo: T? public fun test(): kotlin.Int? diff --git a/compiler/testData/diagnostics/tests/override/ComplexValRedeclaration.kt b/compiler/testData/diagnostics/tests/override/ComplexValRedeclaration.kt index 24c27d44bfb..b5bd0f1c3cc 100644 --- a/compiler/testData/diagnostics/tests/override/ComplexValRedeclaration.kt +++ b/compiler/testData/diagnostics/tests/override/ComplexValRedeclaration.kt @@ -1,3 +1,4 @@ +// !DIAGNOSTICS: -TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER package override.generics abstract class MyAbstractClass { diff --git a/compiler/testData/diagnostics/tests/override/ConflictingPropertySignatureFromSuperclass.kt b/compiler/testData/diagnostics/tests/override/ConflictingPropertySignatureFromSuperclass.kt index c38f3682183..3854e259271 100644 --- a/compiler/testData/diagnostics/tests/override/ConflictingPropertySignatureFromSuperclass.kt +++ b/compiler/testData/diagnostics/tests/override/ConflictingPropertySignatureFromSuperclass.kt @@ -1,3 +1,4 @@ +// !DIAGNOSTICS: -TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER open class Aaa() { val bar = 1 } diff --git a/compiler/testData/diagnostics/tests/override/Generics.kt b/compiler/testData/diagnostics/tests/override/Generics.kt index 2d042fa9527..8d83081ba5d 100644 --- a/compiler/testData/diagnostics/tests/override/Generics.kt +++ b/compiler/testData/diagnostics/tests/override/Generics.kt @@ -43,7 +43,7 @@ abstract class MyAbstractClass1 : MyTrait, MyAbstractClass() { class MyIllegalGenericClass1 : MyTrait, MyAbstractClass() {} class MyIllegalGenericClass2(r : R) : MyTrait, MyAbstractClass() { override fun foo(r: R) = r - override val pr : R = r + override val <T> pr : R = r } class MyIllegalClass1 : MyTrait, MyAbstractClass() {} abstract class MyLegalAbstractClass1 : MyTrait, MyAbstractClass() {} @@ -51,10 +51,10 @@ abstract class MyLegalAbstractClass1 : MyTrait, MyAbstractClass() { class MyIllegalClass2(t : T) : MyTrait, MyAbstractClass() { fun foo(t: T) = t fun bar(t: T) = t - val pr : T = t + val <R> pr : T = t } abstract class MyLegalAbstractClass2(t : T) : MyTrait, MyAbstractClass() { fun foo(t: T) = t fun bar(t: T) = t - val pr : T = t + val <R> pr : T = t } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredTypeParameters.kt b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredTypeParameters.kt index d4340deb6ef..29ffbbce3eb 100644 --- a/compiler/testData/diagnostics/tests/redeclarations/RedeclaredTypeParameters.kt +++ b/compiler/testData/diagnostics/tests/redeclarations/RedeclaredTypeParameters.kt @@ -2,5 +2,5 @@ fun <T, T> class P<T, T> {} -val <T, T> T.foo : Int +val <T, T> T.foo : Int get() = 1 \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBound.kt b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBound.kt index 7bc7846fc26..fd37f7ee7e0 100644 --- a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBound.kt +++ b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBound.kt @@ -1,3 +1,3 @@ -// !DIAGNOSTICS: -MUST_BE_INITIALIZED +// !DIAGNOSTICS: -MUST_BE_INITIALIZED -TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER fun T?> foo() {} val T?> prop diff --git a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundMember.kt b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundMember.kt index 91cc9ac8fc2..bd0f7d0094e 100644 --- a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundMember.kt +++ b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundMember.kt @@ -1,4 +1,4 @@ -// !DIAGNOSTICS: -MUST_BE_INITIALIZED_OR_BE_ABSTRACT +// !DIAGNOSTICS: -MUST_BE_INITIALIZED_OR_BE_ABSTRACT -TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER class My { fun T?> foo() {} val T?> prop: T diff --git a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundNotNull.kt b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundNotNull.kt index 3700e3f4236..d7cb5e2afe3 100644 --- a/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundNotNull.kt +++ b/compiler/testData/diagnostics/tests/regressions/itselfAsUpperBoundNotNull.kt @@ -1,3 +1,3 @@ -// !DIAGNOSTICS: -MUST_BE_INITIALIZED +// !DIAGNOSTICS: -MUST_BE_INITIALIZED -TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER fun T> foo() {} val T?> prop: T diff --git a/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.kt b/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.kt index df667b56306..62cc753059a 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.kt +++ b/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.kt @@ -6,7 +6,7 @@ fun <T : IntArray> f4( fun <T> f5() where T : Array {} -val <T : Array> v = "" +val <T : Array> T.v: String get() = "" class C2A : Array> interface C3A> where A : Array, A : Array diff --git a/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.txt b/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.txt index fa7c8bdb116..502a1732bc0 100644 --- a/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.txt +++ b/compiler/testData/diagnostics/tests/typeParameters/upperBoundCannotBeArray.txt @@ -1,6 +1,6 @@ package -public val > v: kotlin.String = "" +public val > T.v: kotlin.String public fun > f1(): kotlin.Unit public fun > f2(): kotlin.Unit public fun > f3(): kotlin.Unit where A : kotlin.Array diff --git a/compiler/testData/diagnostics/tests/variance/ValProperty.kt b/compiler/testData/diagnostics/tests/variance/ValProperty.kt index a37feea87d6..44bc4f6c705 100644 --- a/compiler/testData/diagnostics/tests/variance/ValProperty.kt +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.kt @@ -34,15 +34,15 @@ abstract class Test { abstract val In<)!>I>.receiver4: Int abstract val In.receiver5: Int - val typeParameter1 = 8 - val O> typeParameter2 = 13 - val typeParameter3 = 21 - val )!>I>> typeParameter4 = 34 - val > typeParameter5 = 55 + val X.typeParameter1: Int get() = 0 + val O> X.typeParameter2: Int get() = 0 + val X.typeParameter3: Int get() = 0 + val )!>I>> X.typeParameter4: Int get() = 0 + val > X.typeParameter5: Int get() = 0 - val typeParameter6 where X : I = 1 - val typeParameter7 where X : O = 1 - val typeParameter8 where X : P = 2 - val typeParameter9 where X : In<)!>I> = 3 - val typeParameter0 where X : In = 5 + val X.typeParameter6: Int where X : I get() = 0 + val X.typeParameter7: Int where X : O get() = 0 + val X.typeParameter8: Int where X : P get() = 0 + val X.typeParameter9: Int where X : In<)!>I> get() = 0 + val X.typeParameter0: Int where X : In get() = 0 } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/ValProperty.txt b/compiler/testData/diagnostics/tests/variance/ValProperty.txt index d09b0f35031..334cfb6e482 100644 --- a/compiler/testData/diagnostics/tests/variance/ValProperty.txt +++ b/compiler/testData/diagnostics/tests/variance/ValProperty.txt @@ -46,21 +46,21 @@ public abstract class Test { public abstract val type3: P public abstract val type4: In public abstract val type5: In - public final val > typeParameter0: kotlin.Int = 5 - public final val typeParameter1: kotlin.Int = 8 - public final val typeParameter2: kotlin.Int = 13 - public final val typeParameter3: kotlin.Int = 21 - public final val > typeParameter4: kotlin.Int = 34 - public final val > typeParameter5: kotlin.Int = 55 - public final val typeParameter6: kotlin.Int = 1 - public final val typeParameter7: kotlin.Int = 1 - public final val typeParameter8: kotlin.Int = 2 - public final val > typeParameter9: kotlin.Int = 3 public abstract val I.receiver1: kotlin.Int public abstract val O.receiver2: kotlin.Int public abstract val P.receiver3: kotlin.Int public abstract val In.receiver4: kotlin.Int public abstract val In.receiver5: kotlin.Int + public final val > X.typeParameter0: kotlin.Int + public final val X.typeParameter1: kotlin.Int + public final val X.typeParameter2: kotlin.Int + public final val X.typeParameter3: kotlin.Int + public final val > X.typeParameter4: kotlin.Int + public final val > X.typeParameter5: kotlin.Int + public final val X.typeParameter6: kotlin.Int + public final val X.typeParameter7: kotlin.Int + public final val X.typeParameter8: kotlin.Int + public final val > X.typeParameter9: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/tests/variance/VarProperty.kt b/compiler/testData/diagnostics/tests/variance/VarProperty.kt index 4465e2c66eb..daec37d510a 100644 --- a/compiler/testData/diagnostics/tests/variance/VarProperty.kt +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.kt @@ -34,15 +34,15 @@ abstract class Test { abstract var In<)!>I>.receiver4: Int abstract var In.receiver5: Int - var typeParameter1 = 8 - var O> typeParameter2 = 13 - var typeParameter3 = 21 - var )!>I>> typeParameter4 = 34 - var > typeParameter5 = 55 + var X.typeParameter1: Int get() = 0; set(i) {} + var O> X.typeParameter2: Int get() = 0; set(i) {} + var X.typeParameter3: Int get() = 0; set(i) {} + var )!>I>> X.typeParameter4: Int get() = 0; set(i) {} + var > X.typeParameter5: Int get() = 0; set(i) {} - var typeParameter6 where X : I = 1 - var typeParameter7 where X : O = 1 - var typeParameter8 where X : P = 2 - var typeParameter9 where X : In<)!>I> = 3 - var typeParameter0 where X : In = 5 + var X.typeParameter6: Int where X : I get() = 0; set(i) {} + var X.typeParameter7: Int where X : O get() = 0; set(i) {} + var X.typeParameter8: Int where X : P get() = 0; set(i) {} + var X.typeParameter9: Int where X : In<)!>I> get() = 0; set(i) {} + var X.typeParameter0: Int where X : In get() = 0; set(i) {} } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/variance/VarProperty.txt b/compiler/testData/diagnostics/tests/variance/VarProperty.txt index 62bb1ba4d1e..67dcfb7e67c 100644 --- a/compiler/testData/diagnostics/tests/variance/VarProperty.txt +++ b/compiler/testData/diagnostics/tests/variance/VarProperty.txt @@ -46,21 +46,21 @@ public abstract class Test { public abstract var type3: P public abstract var type4: In public abstract var type5: In - public final var > typeParameter0: kotlin.Int - public final var typeParameter1: kotlin.Int - public final var typeParameter2: kotlin.Int - public final var typeParameter3: kotlin.Int - public final var > typeParameter4: kotlin.Int - public final var > typeParameter5: kotlin.Int - public final var typeParameter6: kotlin.Int - public final var typeParameter7: kotlin.Int - public final var typeParameter8: kotlin.Int - public final var > typeParameter9: kotlin.Int public abstract var I.receiver1: kotlin.Int public abstract var O.receiver2: kotlin.Int public abstract var P.receiver3: kotlin.Int public abstract var In.receiver4: kotlin.Int public abstract var In.receiver5: kotlin.Int + public final var > X.typeParameter0: kotlin.Int + public final var X.typeParameter1: kotlin.Int + public final var X.typeParameter2: kotlin.Int + public final var X.typeParameter3: kotlin.Int + public final var > X.typeParameter4: kotlin.Int + public final var > X.typeParameter5: kotlin.Int + public final var X.typeParameter6: kotlin.Int + public final var X.typeParameter7: kotlin.Int + public final var X.typeParameter8: kotlin.Int + public final var > X.typeParameter9: kotlin.Int public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt index 5b9a9d9b664..779384f21c1 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/native/optionlBody/native.kt @@ -1,3 +1,6 @@ +// !DIAGNOSTICS: -UNREACHABLE_CODE +// unreachable code suppressed due to KT-9586 + @native val baz: Int @native diff --git a/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.kt b/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.kt index 21e77b5c055..9b901d2eede 100644 --- a/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.kt +++ b/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.kt @@ -6,6 +6,6 @@ class MembersReferenceOuterTP

{ fun g(p: P): P = null!! val v: P = null!! - val w: Q = null!! + val Q.w: Q get() = null!! } } diff --git a/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.txt b/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.txt index 6459d81e85a..8d9679918a2 100644 --- a/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.txt +++ b/compiler/testData/loadJava/compiledKotlin/nested/membersReferenceOuterTP.txt @@ -7,8 +7,8 @@ public final class MembersReferenceOuterTP { /*primary*/ public constructor Inner() public final val v: P public final fun (): P - public final val w: Q - public final fun (): Q + public final val Q.w: Q + public final fun Q.(): Q public final fun f(): kotlin.Unit public final fun g(/*0*/ p: P): P } diff --git a/idea/testData/checker/MultipleBounds.kt b/idea/testData/checker/MultipleBounds.kt index 6a45c9d19be..c8ae3898b33 100644 --- a/idea/testData/checker/MultipleBounds.kt +++ b/idea/testData/checker/MultipleBounds.kt @@ -60,4 +60,6 @@ val t1 = test2<A>(A()) val t2 = test2<B>(C()) val t3 = test2(C()) -val x : Int = 0 +val Pair.x : Int get() = 0 + +class Pair() diff --git a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.kt b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.kt index 7fbf1086988..ad7681667c3 100644 --- a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.kt +++ b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.kt @@ -27,13 +27,13 @@ class TypeParams Int, T4, T5 : Any?, T6 : T5, fun T1.withOwnParamExtensionAfterName(p: T1) { } - val withOwnParam: G1 + val G1.withOwnParam: G1 get() = throw IllegalStateException() - val withOwnBoundedParam: G1 + val G1.withOwnBoundedParam: G1 get() = throw IllegalStateException() - val withOwnBoundedParamByOther: G1 + val G1.withOwnBoundedParamByOther: G1 get() = throw IllegalStateException() val useSomeParam: T2 diff --git a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt index 2e73756f521..007ad2ea0f2 100644 --- a/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt +++ b/idea/testData/decompiler/stubBuilder/TypeParams/TypeParams.txt @@ -84,7 +84,7 @@ PsiJetFileStubImpl[package=test] TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T2] - PROPERTY:[fqName=test.TypeParams.withOwnBoundedParam, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=withOwnBoundedParam] + PROPERTY:[fqName=test.TypeParams.withOwnBoundedParam, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=true, isTopLevel=false, isVar=false, name=withOwnBoundedParam] MODIFIER_LIST:[public final] TYPE_PARAMETER_LIST: TYPE_PARAMETER:[fqName=null, isInVariance=false, isOutVariance=false, name=G1] @@ -97,7 +97,10 @@ PsiJetFileStubImpl[package=test] TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=G1] - PROPERTY:[fqName=test.TypeParams.withOwnBoundedParamByOther, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=withOwnBoundedParamByOther] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=G1] + PROPERTY:[fqName=test.TypeParams.withOwnBoundedParamByOther, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=true, isTopLevel=false, isVar=false, name=withOwnBoundedParamByOther] MODIFIER_LIST:[public final] TYPE_PARAMETER_LIST: TYPE_PARAMETER:[fqName=null, isInVariance=false, isOutVariance=false, name=G1] @@ -107,13 +110,19 @@ PsiJetFileStubImpl[package=test] TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=G1] - PROPERTY:[fqName=test.TypeParams.withOwnParam, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=withOwnParam] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=G1] + PROPERTY:[fqName=test.TypeParams.withOwnParam, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=true, isTopLevel=false, isVar=false, name=withOwnParam] MODIFIER_LIST:[public final] TYPE_PARAMETER_LIST: TYPE_PARAMETER:[fqName=null, isInVariance=false, isOutVariance=false, name=G1] TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=G1] + TYPE_REFERENCE: + USER_TYPE:[isAbsoluteInRootPackage=false] + REFERENCE_EXPRESSION:[referencedName=G1] FUN:[fqName=test.TypeParams.f, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=true, isExtension=false, isTopLevel=false, name=f] MODIFIER_LIST:[public final] ANNOTATION_ENTRY:[hasValueArguments=false, shortName=inline] diff --git a/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt b/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt index 1e5e854d725..0b1b7aeb708 100644 --- a/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt +++ b/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt @@ -1,4 +1,5 @@ // ERROR: Property must be initialized or be abstract +// ERROR: Type parameter of a property must be used in its receiver type class Owner { val p: R diff --git a/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt.after b/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt.after index 1c16897cd39..74cc8703f7a 100644 --- a/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt.after +++ b/idea/testData/intentions/declarations/convertMemberToExtension/genericProperty.kt.after @@ -1,4 +1,5 @@ // ERROR: Property must be initialized or be abstract +// ERROR: Type parameter of a property must be used in its receiver type class Owner { } diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInClass.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInClass.kt index 589fdd6f87c..9f79fc57eb1 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInClass.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInClass.kt @@ -5,7 +5,7 @@ // ERROR: Unresolved reference: foo class A { - val test: T get() { + val T.test: T get() { return foo } } \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInGenClass.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInGenClass.kt index 8454969d118..b5396688ff8 100644 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInGenClass.kt +++ b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenAccessorInGenClass.kt @@ -5,7 +5,7 @@ // ERROR: Unresolved reference: foo class A { - val test: T get() { + val T.test: T get() { return foo } } \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInClass.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInClass.kt deleted file mode 100644 index 6b9e1285883..00000000000 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInClass.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "Create parameter 'foo'" "false" -// ERROR: Unresolved reference: foo -// ACTION: Create property 'foo' - -class A { - val test: T = foo -} \ No newline at end of file diff --git a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInGenClass.kt b/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInGenClass.kt deleted file mode 100644 index bd781b0ece7..00000000000 --- a/idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInGenClass.kt +++ /dev/null @@ -1,7 +0,0 @@ -// "Create parameter 'foo'" "false" -// ACTION: Create property 'foo' -// ERROR: Unresolved reference: foo - -class A { - val test: T = foo -} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java index 5e6e63b9495..1b606ece00d 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/quickfix/QuickFixTestGenerated.java @@ -2660,18 +2660,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest { doTest(fileName); } - @TestMetadata("inGenPropertyInitializerInClass.kt") - public void testInGenPropertyInitializerInClass() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInClass.kt"); - doTest(fileName); - } - - @TestMetadata("inGenPropertyInitializerInGenClass.kt") - public void testInGenPropertyInitializerInGenClass() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/createFromUsage/createVariable/parameter/inGenPropertyInitializerInGenClass.kt"); - doTest(fileName); - } - @TestMetadata("inLambdaNoParams.kt") public void testInLambdaNoParams() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/createFromUsage/createVariable/parameter/inLambdaNoParams.kt"); diff --git a/js/js.translator/testData/dataClass/cases/hashcode.kt b/js/js.translator/testData/dataClass/cases/hashcode.kt index 005ed650834..42a7d6b7c66 100644 --- a/js/js.translator/testData/dataClass/cases/hashcode.kt +++ b/js/js.translator/testData/dataClass/cases/hashcode.kt @@ -32,7 +32,7 @@ fun assertAllEqual(c: Iterable) { val hashCoder: (o: Any) -> Int = { o -> o.hashCode() } -val wrapInH = { t: T -> Holder(t) } +fun wrapInH(t: T) = Holder(t) fun box(): String { @@ -53,14 +53,14 @@ fun box(): String { assertSomeNotEqual(differentOs.map(hashCoder)) // Both Dat's and Obj's wrapped as Holder should retain their hashcode relations. - val sameHDs = sameDs.map(wrapInH) + val sameHDs = sameDs.map { wrapInH(it) } assertAllEqual(sameHDs.map(hashCoder)) - val differentHDs = differentDs.map(wrapInH) + val differentHDs = differentDs.map { wrapInH(it) } assertSomeNotEqual(differentHDs.map(hashCoder)) - val sameHOs = sameOs.map(wrapInH) + val sameHOs = sameOs.map { wrapInH(it) } assertSomeNotEqual(sameHOs.map(hashCoder)) - val differentHOs = differentOs.map(wrapInH) + val differentHOs = differentOs.map { wrapInH(it) } assertSomeNotEqual(differentHOs.map(hashCoder)) return "OK"