diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt index 347e8edc48b..7391c2a3772 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticScopes.kt @@ -48,7 +48,8 @@ class JavaSyntheticScopes( init { val samConversionPerArgumentIsEnabled = - languageVersionSettings.supportsFeature(LanguageFeature.SamConversionPerArgument) + languageVersionSettings.supportsFeature(LanguageFeature.SamConversionPerArgument) && + languageVersionSettings.supportsFeature(LanguageFeature.NewInference) val javaSyntheticPropertiesScope = JavaSyntheticPropertiesScope(storageManager, lookupTracker) val scopesFromExtensions = SyntheticScopeProviderExtension diff --git a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt index 22e22b9cdb2..1286b67628b 100644 --- a/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt +++ b/compiler/testData/diagnostics/tests/callableReference/functionReferenceWithDefaultValueAsOtherFunctionType.kt @@ -13,6 +13,6 @@ fun bar2(body: (String, Int) -> String): String { } fun test() { - bar1(::foo) + bar1(::foo) bar2(::foo) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt index a66c092f403..7ec20ec9c19 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterConstructor.kt @@ -13,5 +13,5 @@ public class J { package test fun test() { - J("", r = { }, z = false) + J("", r = { }, z = false) } diff --git a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt index d50c2a49f28..5d9af118432 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt +++ b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.kt @@ -13,5 +13,5 @@ public class J { package test fun test() { - J.foo("", r = { }, z = false) + J.foo("", r = { }, z = false) } diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt index cb66b6ba475..0f43cdde327 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/samRaw.kt @@ -21,7 +21,7 @@ class B { fun main() { fun println() {} // All parameters in SAM adapter of `foo` have functional types - B().foo({ println() }, B.bar()) + B().foo({ println() }, B.bar()) // So you should use SAM constructors when you want to use mix lambdas and Java objects B().foo(Runnable { println() }, B.bar()) B().foo({ println() }, { it: Any? -> it == null } ) diff --git a/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.fir.kt b/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.fir.kt index e02f9d480f9..0469055b4ff 100644 --- a/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +// !LANGUAGE: +NewInference -SamConversionForKotlinFunctions // FILE: Runnable.java public interface Runnable { void run(); diff --git a/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.kt b/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.kt index 2e41d8f80d7..530bc47077c 100644 --- a/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.kt +++ b/compiler/testData/diagnostics/tests/samConversions/DisabledForKTSimple.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +// !LANGUAGE: +NewInference -SamConversionForKotlinFunctions // FILE: Runnable.java public interface Runnable { void run(); diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt index 3269154b551..8cb08a16972 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -ProhibitVarargAsArrayAfterSamArgument +// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -ProhibitVarargAsArrayAfterSamArgument -SamConversionPerArgument // IGNORE_BACKEND: JS, JS_IR // SKIP_TXT diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt index 30ffee451bc..b19433357fd 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.kt @@ -1,5 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -ProhibitVarargAsArrayAfterSamArgument +// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions -ProhibitVarargAsArrayAfterSamArgument -SamConversionPerArgument // IGNORE_BACKEND: JS, JS_IR // SKIP_TXT diff --git a/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.fir.kt b/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.fir.kt index 65297f5306b..83caa77e696 100644 --- a/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +// !LANGUAGE: +NewInference -SamConversionForKotlinFunctions // FILE: Runnable.java public interface Runnable { void run(); diff --git a/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.kt b/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.kt index 92b190304ac..7b6211a7b0d 100644 --- a/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.kt +++ b/compiler/testData/diagnostics/tests/samConversions/checkSamConversionsAreDisabledByDefault.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: +NewInference +// !LANGUAGE: +NewInference -SamConversionForKotlinFunctions // FILE: Runnable.java public interface Runnable { void run(); diff --git a/compiler/testData/diagnostics/tests/samConversions/samConversionsWithSmartCasts.kt b/compiler/testData/diagnostics/tests/samConversions/samConversionsWithSmartCasts.kt index 09931b03bd7..387525c939b 100644 --- a/compiler/testData/diagnostics/tests/samConversions/samConversionsWithSmartCasts.kt +++ b/compiler/testData/diagnostics/tests/samConversions/samConversionsWithSmartCasts.kt @@ -25,7 +25,7 @@ fun test3(a: () -> Unit) { fun test4(a: () -> Unit, b: () -> Unit) { if (a is Runnable) { - J().run2(a, b) + J().run2(a, b) } } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt index f0e62c09462..308acfa0c82 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.kt @@ -21,7 +21,7 @@ class B : A() { } if (d.x is B) { - d.x.foo {} + d.x.foo {} } } } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt index 0f3160e2a19..680412ce5dd 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/InnerClassInGeneric.kt @@ -2,7 +2,7 @@ // FILE: KotlinFile.kt fun foo(javaClass: JavaClass): Int { val inner = javaClass.createInner() - return inner.doSomething(1, "") { } + return inner.doSomething(1, "") { } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt index 3add3166896..c0f3ecee47e 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/NoNamedArgsAllowed.kt @@ -1,9 +1,9 @@ // !WITH_NEW_INFERENCE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - javaClass.doSomething(p = 1) { + javaClass.doSomething(p = 1) { bar() - } + } } fun bar(){} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt index 3da385c170f..044299fd325 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.kt @@ -1,7 +1,7 @@ // !WITH_NEW_INFERENCE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - javaClass.doSomething { } + javaClass.doSomething { } } // FILE: JavaClass.java diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.kt index 422c631a52f..bb124c9350c 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Simple.kt @@ -12,9 +12,9 @@ fun foo(javaClass: JavaClass, kotlinClass: KotlinClass) { bar() } - kotlinClass.doSomething { + kotlinClass.doSomething { bar() - } + } javaClass.doSomething2 { bar() diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/propertyDelegateBy.dynamic.txt b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/propertyDelegateBy.dynamic.txt index 10c95283ca3..d2b719fa643 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/propertyDelegateBy.dynamic.txt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/propertyDelegateBy.dynamic.txt @@ -1,4 +1,6 @@ +public final fun provideDelegate(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic public final fun getValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic public final fun setValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic, /*2*/ p2: dynamic): dynamic +public final fun provideDelegate(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic public final fun getValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic public final fun getValue(/*0*/ p0: dynamic, /*1*/ p1: dynamic): dynamic diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/platformDependent.kt b/compiler/testData/diagnostics/testsWithJsStdLib/platformDependent.kt index 999f379fc9b..6c27efb5236 100644 --- a/compiler/testData/diagnostics/testsWithJsStdLib/platformDependent.kt +++ b/compiler/testData/diagnostics/testsWithJsStdLib/platformDependent.kt @@ -1,5 +1,5 @@ fun test(m: Map, mm: MutableMap) { - m.getOrDefault("2", 1) - mm.getOrDefault(1, "2") + m.getOrDefault("2", 1) + mm.getOrDefault(1, "2") mm.remove(1, "2") } diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.fir.kt index 1be46380004..3e85d5f48e6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.fir.kt @@ -1,3 +1,6 @@ +// !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + // FILE: A.java public @interface A { String[] value(); diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt index ad2aa0aa42a..6f43e4fdf94 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt @@ -1,3 +1,6 @@ +// !WITH_NEW_INFERENCE +// NI_EXPECTED_FILE + // FILE: A.java public @interface A { String[] value(); @@ -23,5 +26,5 @@ public @interface A { @A fun test8() {} @A(x = Any::class, *arrayOf("5", "6"), "7", y = 3) fun test9() {} -@A(x = Any::class, value = ["5", "6"], "7", y = 3) fun test10() {} +@A(x = Any::class, value = ["5", "6"], "7", y = 3) fun test10() {} @A(x = Any::class, value = ["5", "6", "7"], y = 3) fun test11() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.ni.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.ni.txt new file mode 100644 index 00000000000..fa3940b3cad --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.ni.txt @@ -0,0 +1,23 @@ +package + +@A(value = {"1", "2", "3"}) public fun test1(): kotlin.Unit +@A(value = {"5", "6"}, x = "7", y = 3) public fun test10(): kotlin.Unit +@A(value = {"5", "6", "7"}, x = kotlin.Any::class, y = 3) public fun test11(): kotlin.Unit +@A(value = {"4"}) public fun test2(): kotlin.Unit +@A(value = {{"5", "6"}, "7"}) public fun test3(): kotlin.Unit +@A(value = {"1", "2", "3"}, x = kotlin.String::class) public fun test4(): kotlin.Unit +@A(value = {"4"}, y = 2) public fun test5(): kotlin.Unit +@A(value = {{"5", "6"}, "7"}, x = kotlin.Any::class, y = 3) public fun test6(): kotlin.Unit +@A(value = {}) public fun test7(): kotlin.Unit +@A(value = {}) public fun test8(): kotlin.Unit +@A(value = {}, x = kotlin.Any::class, y = 3) public fun test9(): kotlin.Unit + +public final annotation class A : kotlin.Annotation { + public constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array*/, /*1*/ x: kotlin.reflect.KClass<*> = ..., /*2*/ y: kotlin.Int = ...) + public final val value: kotlin.Array + public final val x: kotlin.reflect.KClass<*> + public final val y: 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/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt index c59c484cd25..8288fe0214a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt @@ -77,13 +77,13 @@ fun test() { this@a.yield(1) this@a.yield2(1) - with(this) { - yield("") - this@with.yield("") + with(this) { + yield("") + this@with.yield("") - yield2("") - this@with.yield2("") - } + yield2("") + this@with.yield2("") + } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt index 198c4d0995e..38be2d4af7d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_3.kt @@ -83,11 +83,11 @@ fun test() { this@a.yield2(1) with(this) { - yield("") - this@with.yield("") + yield("") + this@with.yield("") - yield2("") - this@with.yield2("") + yield2("") + this@with.yield2("") } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt index bd8751f3f84..b729d7c6e91 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.kt @@ -1,7 +1,7 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE -// COMMON_COROUTINES_TEST // !WITH_NEW_INFERENCE +// COMMON_COROUTINES_TEST import COROUTINES_PACKAGE.* class Controller { @@ -38,7 +38,7 @@ fun test() { severalParams("", 89) checkType { _() } // TODO: should we allow somehow to call with passing continuation explicitly? - severalParams("", 89, 6.9) checkType { _() } - severalParams("", 89, this as Continuation) checkType { _() } + severalParams("", 89, 6.9) checkType { _() } + severalParams("", 89, this as Continuation) checkType { _() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.fir.kt index a5feb405213..ca950c13b30 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.fir.kt @@ -1,3 +1,5 @@ +// !WITH_NEW_INFERENCE + // FILE: J.java import kotlin.jvm.functions.Function1; diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt index d0cee3e8629..acd58d9790b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt9820_javaFunctionTypeInheritor.kt @@ -1,3 +1,5 @@ +// !WITH_NEW_INFERENCE + // FILE: J.java import kotlin.jvm.functions.Function1; @@ -12,5 +14,5 @@ fun useJ(j: J) { } fun jj() { - useJ({}) + useJ({}) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt index 39ea5223af3..23b2268fa37 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -RefinedSamAdaptersPriority +// !LANGUAGE: -RefinedSamAdaptersPriority -NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.kt index 281ea18b652..3ec7ab2247e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -RefinedSamAdaptersPriority +// !LANGUAGE: -RefinedSamAdaptersPriority -NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt index db8e64fa963..cacba88804e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -RefinedSamAdaptersPriority +// !LANGUAGE: -RefinedSamAdaptersPriority -NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.kt index 544a5019925..cb05faaaac3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.kt @@ -1,4 +1,4 @@ -// !LANGUAGE: -RefinedSamAdaptersPriority +// !LANGUAGE: -RefinedSamAdaptersPriority -NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER // !CHECK_TYPE // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt b/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt index 14a18f20ef5..ce5e61ce241 100644 --- a/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt +++ b/compiler/testData/diagnostics/testsWithUnsignedTypes/conversions/inferenceForSignedAndUnsignedTypes.kt @@ -10,7 +10,7 @@ fun select(x: K, y: K): K = TODO() fun takeUByte(u: UByte) {} fun foo() { - select(1, 1u) checkType { _>() } + select(1, 1u) checkType { _>() } takeUByte(id(1)) 1 + 1u diff --git a/compiler/testData/foreignAnnotationsJava8/tests/jsr305/typeArguments.kt b/compiler/testData/foreignAnnotationsJava8/tests/jsr305/typeArguments.kt index 16c24caa4fb..563e5ed7c72 100644 --- a/compiler/testData/foreignAnnotationsJava8/tests/jsr305/typeArguments.kt +++ b/compiler/testData/foreignAnnotationsJava8/tests/jsr305/typeArguments.kt @@ -1,4 +1,5 @@ // !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER +// !WITH_NEW_INFERENCE // RENDER_PACKAGE: test // SKIP_COMPILED_JAVA @@ -88,9 +89,9 @@ fun main(a: test.A, l: L, Int?>, l1: L, Int>) a.bar(l1 as L, Int?>) a.baz1().t().containsKey("") - a.baz1().t().containsKey(null) + a.baz1().t().containsKey(null) a.baz1().t().containsValue(1) - a.baz1().t().containsValue(null) + a.baz1().t().containsValue(null) a.baz1().s().hashCode() a.baz1().setT(l.t()) @@ -104,8 +105,8 @@ fun main(a: test.A, l: L, Int?>, l1: L, Int>) a.baz2().s().hashCode() a.baz3().t().containsKey("") - a.baz3().t().containsKey(null) + a.baz3().t().containsKey(null) a.baz3().t().containsValue(1) - a.baz3().t().containsValue(null) + a.baz3().t().containsValue(null) a.baz3().s().hashCode() } diff --git a/compiler/testData/javaModules/jdkModulesFromNamed/main.txt b/compiler/testData/javaModules/jdkModulesFromNamed/main.txt index 8768f45c1be..23263452275 100644 --- a/compiler/testData/javaModules/jdkModulesFromNamed/main.txt +++ b/compiler/testData/javaModules/jdkModulesFromNamed/main.txt @@ -1,7 +1,33 @@ compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:11:24: error: unresolved reference: httpserver val s: com.sun.net.httpserver.HttpServer? = null ^ +compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:12:5: error: overload resolution ambiguity: +public inline fun println(message: Any?): Unit defined in kotlin.io +public inline fun println(message: Boolean): Unit defined in kotlin.io +public inline fun println(message: Byte): Unit defined in kotlin.io +public inline fun println(message: Char): Unit defined in kotlin.io +public inline fun println(message: CharArray): Unit defined in kotlin.io +public inline fun println(message: Double): Unit defined in kotlin.io +public inline fun println(message: Float): Unit defined in kotlin.io +public inline fun println(message: Int): Unit defined in kotlin.io +public inline fun println(message: Long): Unit defined in kotlin.io +public inline fun println(message: Short): Unit defined in kotlin.io + println(s) + ^ compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:19:20: error: unresolved reference: javafx val x: com.sun.javafx.tools.ant.AntLog? = null ^ +compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:20:5: error: overload resolution ambiguity: +public inline fun println(message: Any?): Unit defined in kotlin.io +public inline fun println(message: Boolean): Unit defined in kotlin.io +public inline fun println(message: Byte): Unit defined in kotlin.io +public inline fun println(message: Char): Unit defined in kotlin.io +public inline fun println(message: CharArray): Unit defined in kotlin.io +public inline fun println(message: Double): Unit defined in kotlin.io +public inline fun println(message: Float): Unit defined in kotlin.io +public inline fun println(message: Int): Unit defined in kotlin.io +public inline fun println(message: Long): Unit defined in kotlin.io +public inline fun println(message: Short): Unit defined in kotlin.io + println(x) + ^ COMPILATION_ERROR diff --git a/compiler/testData/javaModules/jdkModulesFromUnnamed/main.txt b/compiler/testData/javaModules/jdkModulesFromUnnamed/main.txt index 29368c32161..f93be16ff13 100644 --- a/compiler/testData/javaModules/jdkModulesFromUnnamed/main.txt +++ b/compiler/testData/javaModules/jdkModulesFromUnnamed/main.txt @@ -1,4 +1,17 @@ compiler/testData/javaModules/jdkModulesFromUnnamed/main/test.kt:19:33: error: unresolved reference: ant val x: com.sun.javafx.tools.ant.AntLog? = null ^ +compiler/testData/javaModules/jdkModulesFromUnnamed/main/test.kt:20:5: error: overload resolution ambiguity: +public inline fun println(message: Any?): Unit defined in kotlin.io +public inline fun println(message: Boolean): Unit defined in kotlin.io +public inline fun println(message: Byte): Unit defined in kotlin.io +public inline fun println(message: Char): Unit defined in kotlin.io +public inline fun println(message: CharArray): Unit defined in kotlin.io +public inline fun println(message: Double): Unit defined in kotlin.io +public inline fun println(message: Float): Unit defined in kotlin.io +public inline fun println(message: Int): Unit defined in kotlin.io +public inline fun println(message: Long): Unit defined in kotlin.io +public inline fun println(message: Short): Unit defined in kotlin.io + println(x) + ^ COMPILATION_ERROR diff --git a/compiler/testData/repl/noWarningsWithErrors.repl b/compiler/testData/repl/noWarningsWithErrors.repl index 210ecb7df3a..2b0793bd571 100644 --- a/compiler/testData/repl/noWarningsWithErrors.repl +++ b/compiler/testData/repl/noWarningsWithErrors.repl @@ -3,9 +3,6 @@ error: unresolved reference: unresolved (listOf(1) as List).unresolved() ^ >>> listOf(1!!) -error: the integer literal does not conform to the expected type String? +error: type mismatch: inferred type is IntegerLiteralType[Int,Long,Byte,Short] but String was expected listOf(1!!) - ^ -error: type mismatch: inferred type is Int but String was expected -listOf(1!!) - ^ + ^ \ No newline at end of file diff --git a/compiler/testData/resolve/ExtensionFunctions.resolve b/compiler/testData/resolve/ExtensionFunctions.resolve index 28de6f75ddc..79f5335dfa9 100644 --- a/compiler/testData/resolve/ExtensionFunctions.resolve +++ b/compiler/testData/resolve/ExtensionFunctions.resolve @@ -14,7 +14,6 @@ 1.`foo`foo() true.`T.foo`foo() - 3.`!null`foo(4) 1 } diff --git a/compiler/testData/resolve/ResolveOfInfixExpressions.resolve b/compiler/testData/resolve/ResolveOfInfixExpressions.resolve index 2a2ee83c8d1..c8f705a6313 100644 --- a/compiler/testData/resolve/ResolveOfInfixExpressions.resolve +++ b/compiler/testData/resolve/ResolveOfInfixExpressions.resolve @@ -69,7 +69,6 @@ fun tt(t : T) : T { (x`java::java.util.ArrayList.set()`[1]) = null x`java::java.util.ArrayList.set()`[null] = null (x`java::java.util.ArrayList.set()`[null, 2]) = null - (`not`!foo)[1]`:kotlin::Char` val y = Bar() y`inc`++ `inc`++y