Update tests after switching to LV 1.9

This commit is contained in:
Dmitriy Novozhilov
2023-01-23 11:34:48 +02:00
committed by Space Team
parent 66544a4e00
commit 88efa6bfb6
279 changed files with 1520 additions and 1239 deletions
@@ -26,6 +26,7 @@ object CompilerExecutor {
addAll(options)
add("-d")
add(library.absolutePathString())
add("-XXLanguage:-SkipStandaloneScriptsInSourceRoots")
}
try {
MockLibraryUtil.runJvmCompiler(commands)
@@ -153,7 +153,7 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
fun testSimpleScriptLocal() {
val messageCollector = TestMessageCollector()
val (code, outputs) = compileLocally(messageCollector, File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
"-d", tmpdir.absolutePath, "-Xreport-output-files")
"-d", tmpdir.absolutePath, "-Xreport-output-files", "-Xallow-any-scripts-in-source-roots")
Assert.assertEquals(0, code)
Assert.assertTrue(outputs.isNotEmpty())
Assert.assertEquals(File(tmpdir, "Script.class").absolutePath, outputs.first().outputFile?.absolutePath)
@@ -173,7 +173,8 @@ class CompilerApiTest : KotlinIntegrationTestBase() {
try {
val (code, outputs) = compileOnDaemon(
flagFile, compilerId, daemonJVMOptions, daemonOptions, TestMessageCollector(),
File(getSimpleScriptBaseDir(), "script.kts").absolutePath, "-Xreport-output-files", "-d", tmpdir.absolutePath
File(getSimpleScriptBaseDir(), "script.kts").absolutePath,
"-Xreport-output-files", "-Xallow-any-scripts-in-source-roots", "-d", tmpdir.absolutePath
)
Assert.assertEquals(0, code)
Assert.assertTrue(outputs.isNotEmpty())
@@ -32,9 +32,9 @@ inline class ReservedMembersMfvc(val x: Int, val y: Int) {
inline class SecondaryConstructors(val x: Int) {
constructor(y: String) : this(5)
constructor(x: Int, y: String) : this(x) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{
constructor(x: Int, y: String) : this(x) {
}<!>
}
}
<!VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION!>value<!> class WithInner(val x: String) {
@@ -16857,12 +16857,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/enum/noClassForSimpleEnum.kt");
}
@Test
@TestMetadata("objectInEnum.kt")
public void testObjectInEnum() throws Exception {
runTest("compiler/testData/codegen/box/enum/objectInEnum.kt");
}
@Test
@TestMetadata("ordinal.kt")
public void testOrdinal() throws Exception {
@@ -20426,12 +20420,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inference/builderInference/kt47744.kt");
}
@Test
@TestMetadata("kt48445.kt")
public void testKt48445() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt48445.kt");
}
@Test
@TestMetadata("kt48633.kt")
public void testKt48633() throws Exception {
@@ -20444,12 +20432,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inference/builderInference/kt49887.kt");
}
@Test
@TestMetadata("kt50520.kt")
public void testKt50520() throws Exception {
runTest("compiler/testData/codegen/box/inference/builderInference/kt50520.kt");
}
@Test
@TestMetadata("kt51988.kt")
public void testKt51988() throws Exception {
@@ -232,12 +232,6 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
runTest("compiler/testData/ir/irText/classes/kt43217.kt");
}
@Test
@TestMetadata("kt44013.kt")
public void testKt44013() throws Exception {
runTest("compiler/testData/ir/irText/classes/kt44013.kt");
}
@Test
@TestMetadata("kt45853.kt")
public void testKt45853() throws Exception {
@@ -232,12 +232,6 @@ public class LightTreeFir2IrTextTestGenerated extends AbstractLightTreeFir2IrTex
runTest("compiler/testData/ir/irText/classes/kt43217.kt");
}
@Test
@TestMetadata("kt44013.kt")
public void testKt44013() throws Exception {
runTest("compiler/testData/ir/irText/classes/kt44013.kt");
}
@Test
@TestMetadata("kt45853.kt")
public void testKt45853() throws Exception {
@@ -1,6 +1,9 @@
public enum AnnotatedParameterInEnumConstructor /* test.AnnotatedParameterInEnumConstructor*/ {
A;
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<test.AnnotatedParameterInEnumConstructor> getEntries();// getEntries()
@org.jetbrains.annotations.NotNull()
public static test.AnnotatedParameterInEnumConstructor valueOf(java.lang.String) throws java.lang.IllegalArgumentException, java.lang.NullPointerException;// valueOf(java.lang.String)
@@ -3,6 +3,9 @@ public enum E /* p.E*/ {
Entry2,
@kotlin.Deprecated(message = "b") Entry3;
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<p.E> getEntries();// getEntries()
@org.jetbrains.annotations.NotNull()
public static p.E valueOf(java.lang.String) throws java.lang.IllegalArgumentException, java.lang.NullPointerException;// valueOf(java.lang.String)
@@ -1,6 +1,9 @@
public enum MyEnumClass /* one.MyEnumClass*/ {
Entry;
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<one.MyEnumClass> getEntries();// getEntries()
@org.jetbrains.annotations.NotNull()
public static one.MyEnumClass valueOf(java.lang.String) throws java.lang.IllegalArgumentException, java.lang.NullPointerException;// valueOf(java.lang.String)
@@ -7,5 +7,8 @@ public enum EnumNameOverride /* EnumNameOverride*/ implements Bar {
@org.jetbrains.annotations.NotNull()
public static EnumNameOverride[] values();// values()
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<EnumNameOverride> getEntries();// getEntries()
private EnumNameOverride();// .ctor()
}
@@ -44,6 +44,9 @@ public enum StrangeEnum /* StrangeEnum*/ {
@org.jetbrains.annotations.NotNull()
public static StrangeEnum[] values();// values()
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<StrangeEnum> getEntries();// getEntries()
private StrangeEnum(java.lang.String);// .ctor(java.lang.String)
}
@@ -44,6 +44,9 @@ public enum StrangeEnum /* StrangeEnum*/ {
@org.jetbrains.annotations.NotNull()
public static StrangeEnum[] values();// values()
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<StrangeEnum> getEntries();// getEntries()
private StrangeEnum(java.lang.String);// .ctor(java.lang.String)
}
-1
View File
@@ -1,3 +1,2 @@
warning: language version 1.9 is experimental, there are no backwards compatibility guarantees for new language and library features
error: old Kotlin/JS compiler is no longer supported. Please migrate to the new JS IR backend
COMPILATION_ERROR
@@ -1,2 +1,2 @@
error: language version 1.1 is no longer supported; please, use version 1.3 or greater.
error: language version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown API version: 239.42
Supported API versions: 1.3 (deprecated), 1.4 (deprecated), 1.5, 1.6, 1.7, 1.8, 1.9 (experimental), 2.0 (experimental)
Supported API versions: 1.4 (deprecated), 1.5 (deprecated), 1.6, 1.7, 1.8, 1.9, 2.0 (experimental)
COMPILATION_ERROR
+1 -1
View File
@@ -1,4 +1,4 @@
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
@@ -1,4 +1,4 @@
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
+1 -1
View File
@@ -1,2 +1,2 @@
error: API version 1.1 is no longer supported; please, use version 1.3 or greater.
error: API version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -1,6 +1,6 @@
warning: flag is not supported by this version of the compiler: -Xdouble ' quote ' escaped " sequence /
warning: flag is not supported by this version of the compiler: -Xsingle " quote " escaped ' sequence /
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
@@ -1,2 +1,2 @@
error: language version 1.2 is no longer supported; please, use version 1.3 or greater.
error: language version 1.2 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -7,7 +7,7 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
compiler/testData/cli/jvm/enumEntriesForJavaNotEnabled.kt:4:49: error: the feature "enum entries" is only available since language version 1.9
compiler/testData/cli/jvm/enumEntriesForJavaNotEnabled.kt:4:49: error: the feature "enum entries" is disabled
val entries = java.util.concurrent.TimeUnit.entries
^
COMPILATION_ERROR
+1 -1
View File
@@ -7,7 +7,7 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
compiler/testData/cli/jvm/enumEntriesNotEnabled.kt:7:26: error: the feature "enum entries" is only available since language version 1.9
compiler/testData/cli/jvm/enumEntriesNotEnabled.kt:7:26: error: the feature "enum entries" is disabled
val entries = MyEnum.entries
^
COMPILATION_ERROR
+1
View File
@@ -1,3 +1,4 @@
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: type mismatch: inferred type is Nothing? but String was expected
a.foo(null)
^
+2 -5
View File
@@ -1,7 +1,4 @@
compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: warning: type mismatch: inferred type is Nothing? but String was expected
compiler/testData/cli/jvm/jspecifyUsage.kt:2:11: error: null can not be a value of a non-null type String
a.foo(null)
^
compiler/testData/cli/jvm/jspecifyUsage.kt:3:5: warning: unsafe use of a nullable receiver of type String?
a.bar().hashCode()
^
OK
COMPILATION_ERROR
+1
View File
@@ -1 +1,2 @@
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
OK
+1
View File
@@ -7,5 +7,6 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
info: using preview Java language features
OK
+1
View File
@@ -7,6 +7,7 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/jvmRecord.kt:1:1: error: using @JvmRecord is only allowed with -jvm-target 16 or later (or -jvm-target 15 with the -Xjvm-enable-preview flag enabled)
@JvmRecord
^
@@ -1,2 +1,2 @@
error: language version 1.0 is no longer supported; please, use version 1.3 or greater.
error: language version 1.0 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown language version: 239.42
Supported language versions: 1.3 (deprecated), 1.4 (deprecated), 1.5, 1.6, 1.7, 1.8, 1.9 (experimental), 2.0 (experimental)
Supported language versions: 1.4 (deprecated), 1.5 (deprecated), 1.6, 1.7, 1.8, 1.9, 2.0 (experimental)
COMPILATION_ERROR
+1 -1
View File
@@ -1,2 +1,2 @@
error: language version 1.1 is no longer supported; please, use version 1.3 or greater.
error: language version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
+1 -1
View File
@@ -1,4 +1,4 @@
warning: API version 1.4 is deprecated and its support will be removed in a future version of Kotlin
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/apiVersion.kt:4:5: warning: parameter 'p00' is never used
p00: A, p01: A, p02: A, p03: A, p04: A, p05: A, p06: A, p07: A, p08: A, p09: A,
^
+1
View File
@@ -1,3 +1,4 @@
warning: language version is automatically inferred to 1.5 when using the old JVM backend. Consider specifying -language-version explicitly, or remove -Xuse-old-backend
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
error: -Xuse-old-backend is no longer supported. Please migrate to the new JVM IR backend
COMPILATION_ERROR
+1
View File
@@ -1,3 +1,4 @@
warning: language version is automatically inferred to 1.5 when using the old JVM backend. Consider specifying -language-version explicitly, or remove -Xuse-old-backend
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
warning: -Xuse-old-backend is no longer supported. Please migrate to the new JVM IR backend
OK
+1
View File
@@ -1,3 +1,4 @@
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
compiler/testData/cli/jvm/progressive/tailrecOnVirtualMember.kt:2:5: error: tailrec is not allowed on open members
tailrec open fun foo(x: Int) {}
^
@@ -1,2 +1,2 @@
error: language version 1.1 is no longer supported; please, use version 1.3 or greater.
error: language version 1.1 is no longer supported; please, use version 1.4 or greater.
COMPILATION_ERROR
@@ -1 +1,2 @@
warning: language version 1.5 is deprecated and its support will be removed in a future version of Kotlin
OK
@@ -7,10 +7,14 @@ final class foo/Kotlin$A : foo/Kotlin {
Ljava/lang/Enum<Lfoo/Kotlin;>;
public class foo/Kotlin : java/lang/Enum {
private final static kotlin.enums.EnumEntries $ENTRIES
private final static foo.Kotlin[] $VALUES
public final static foo.Kotlin A
private final static foo.Kotlin[] $entries()
private final static foo.Kotlin[] $values()
static void <clinit>()
@@ -3,6 +3,7 @@
// IGNORE_BACKEND_K2: JVM_IR
// WASM_MUTE_REASON: IGNORED_IN_JS
// FIR status: don't support legacy feature. UNINITIALIZED_PARAMETER y. See KT-49800
// LANGUAGE: -ProhibitIllegalValueParameterUsageInDefaultArguments
fun f(
f1: () -> String = { f2() },
@@ -1,3 +1,4 @@
// LANGUAGE: -ProhibitIllegalValueParameterUsageInDefaultArguments
// IGNORE_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR, JS_IR, NATIVE
// FIR status: don't support legacy feature. UNINITIALIZED_PARAMETER y. See KT-49800
@@ -0,0 +1,40 @@
@kotlin.Metadata
public final class Delegate {
// source: 'memberExtensionPropertyAndImportFromObject.kt'
public method <init>(): void
public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Object): java.lang.String
}
@kotlin.Metadata
public final enum class E {
// source: 'memberExtensionPropertyAndImportFromObject.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final enum static field X: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
public static method getEntries(): kotlin.enums.EnumEntries
public static method valueOf(p0: java.lang.String): E
public static method values(): E[]
}
@kotlin.Metadata
public final class MemberExtensionPropertyAndImportFromObjectKt {
// source: 'memberExtensionPropertyAndImportFromObject.kt'
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
private final static @org.jetbrains.annotations.NotNull field result$delegate: Delegate
static method <clinit>(): void
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
public final static @org.jetbrains.annotations.NotNull method getResult(): java.lang.String
}
@kotlin.Metadata
public final class O {
// source: 'memberExtensionPropertyAndImportFromObject.kt'
public final static @org.jetbrains.annotations.NotNull field INSTANCE: O
static method <clinit>(): void
private method <init>(): void
public final @org.jetbrains.annotations.NotNull method getD(@org.jetbrains.annotations.NotNull p0: E): Delegate
}
@@ -8,8 +8,10 @@ public final class Delegate {
@kotlin.Metadata
public final enum class E {
// source: 'memberExtensionPropertyAndImportFromObject.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final enum static field X: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
@@ -1,5 +1,4 @@
// CHECK_BYTECODE_LISTING
// FIR_IDENTICAL
import O.d
@@ -0,0 +1,39 @@
@kotlin.Metadata
public final class Delegate {
// source: 'memberExtensionPropertyAndLocalDelegatedProperty.kt'
public method <init>(): void
public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Object): java.lang.String
}
@kotlin.Metadata
public final enum class E {
// source: 'memberExtensionPropertyAndLocalDelegatedProperty.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final enum static field X: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
public static method getEntries(): kotlin.enums.EnumEntries
public static method valueOf(p0: java.lang.String): E
public static method values(): E[]
}
@kotlin.Metadata
public final class MemberExtensionPropertyAndLocalDelegatedPropertyKt {
// source: 'memberExtensionPropertyAndLocalDelegatedProperty.kt'
synthetic final static field $$delegatedProperties: kotlin.reflect.KProperty[]
static method <clinit>(): void
private final static method box$lambda$1$lambda$0(p0: Delegate): java.lang.String
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
}
@kotlin.Metadata
public final class O {
// source: 'memberExtensionPropertyAndLocalDelegatedProperty.kt'
public final static @org.jetbrains.annotations.NotNull field INSTANCE: O
static method <clinit>(): void
private method <init>(): void
public final @org.jetbrains.annotations.NotNull method getD(@org.jetbrains.annotations.NotNull p0: E): Delegate
}
@@ -8,8 +8,10 @@ public final class Delegate {
@kotlin.Metadata
public final enum class E {
// source: 'memberExtensionPropertyAndLocalDelegatedProperty.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final enum static field X: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
@@ -1,5 +1,4 @@
// CHECK_BYTECODE_LISTING
// FIR_IDENTICAL
enum class E { X }
@@ -12,12 +12,15 @@ public final class DelegateToEnumKt {
@kotlin.Metadata
public final enum class E {
// source: 'delegateToEnum.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final enum static field NOT_OK: E
public final enum static field OK: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
public static method getEntries(): kotlin.enums.EnumEntries
public static method valueOf(p0: java.lang.String): E
public static method values(): E[]
}
@@ -21,12 +21,15 @@ public final class DelegateToEnumInAClassKt {
@kotlin.Metadata
public final enum class E {
// source: 'delegateToEnumInAClass.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final enum static field NOT_OK: E
public final enum static field OK: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
public static method getEntries(): kotlin.enums.EnumEntries
public static method valueOf(p0: java.lang.String): E
public static method values(): E[]
}
@@ -9,12 +9,15 @@ public final class E$Companion {
@kotlin.Metadata
public final enum class E {
// source: 'withSideEffectsToEnum.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: E[]
public final static @org.jetbrains.annotations.NotNull field Companion: E$Companion
public final enum static field X: E
private synthetic final static method $entries(): E[]
private synthetic final static method $values(): E[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
public static method getEntries(): kotlin.enums.EnumEntries
public static method valueOf(p0: java.lang.String): E
public static method values(): E[]
public final inner class E$Companion
@@ -1,6 +1,7 @@
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_K2: JVM_IR
// K2 status: declaringClass is error for enums since Kotlin 1.9
// LANGUAGE: -ProhibitEnumDeclaringClass
package test
-24
View File
@@ -1,24 +0,0 @@
// !LANGUAGE: -NestedClassesInEnumEntryShouldBeInner
enum class E {
ENTRY,
SUBCLASS {
// Because of KT-45115 classes/objects inside enum entries are local in FIR
@Suppress("LOCAL_OBJECT_NOT_ALLOWED")
object O {
fun foo() = 2
}
override fun bar() = O.foo()
};
object O {
fun foo() = 1
}
open fun bar() = O.foo()
}
fun box(): String {
if (E.ENTRY.bar() != 1) return "Fail 1"
if (E.SUBCLASS.bar() != 2) return "Fail 2"
return "OK"
}
@@ -4,7 +4,7 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 1 java/lang/invoke/LambdaMetafactory
// 2 java/lang/invoke/LambdaMetafactory
// FILE: enumValues.kt
enum class ABC(val x: String = "") {
@@ -4,7 +4,7 @@
// CHECK_BYTECODE_TEXT
// JVM_IR_TEMPLATES
// 1 java/lang/invoke/LambdaMetafactory
// 2 java/lang/invoke/LambdaMetafactory
// FILE: enumValues.kt
enum class ABC(val x: String = "") {
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
class Class {
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
package test
@@ -1,4 +1,5 @@
// WITH_STDLIB
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
open class Foo {
lateinit var bar: String
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
// On JVM, isInitialized on a property from another file is forbidden because lateinit-ness is not included in the an ABI of a property.
// IGNORE_BACKEND_K1: JVM, JVM_IR
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
fun <T> eval(fn: () -> T) = fn()
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
// IGNORE_BACKEND: JS, JS_IR_ES6
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
class Foo {
@@ -1,3 +1,4 @@
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
lateinit var bar: String
@@ -1,4 +1,5 @@
// TARGET_BACKEND: NATIVE
// LANGUAGE: -NativeJsProhibitLateinitIsInitalizedIntrinsicWithoutPrivateAccess
// WITH_STDLIB
// MODULE: lib
@@ -1,13 +1,16 @@
@kotlin.Metadata
public final enum class Test {
// source: 'deprecatedEnumEntryFields.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: Test[]
public deprecated final enum static @kotlin.Deprecated(message="") field ENTRY1: Test
public final enum static field ENTRY2: Test
public deprecated final enum static @kotlin.Deprecated(message="") field ENTRY3: Test
private synthetic final static method $entries(): Test[]
private synthetic final static method $values(): Test[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
public static method getEntries(): kotlin.enums.EnumEntries
public static method valueOf(p0: java.lang.String): Test
public static method values(): Test[]
}
@@ -9,7 +9,7 @@ public class Base {
public final class Derived {
// source: 'hidden.kt'
public synthetic deprecated @kotlin.Deprecated(message="", level=HIDDEN) method <init>(): void
public synthetic method f(): void
public method f(): void
}
@kotlin.Metadata
+8
View File
@@ -7,10 +7,12 @@ public annotation class Ann {
@kotlin.Metadata
public final enum class SimpleEnum {
// source: 'enum.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: SimpleEnum[]
public final enum static field A: SimpleEnum
public final enum static field B: SimpleEnum
public final enum static field C: SimpleEnum
private synthetic final static method $entries(): SimpleEnum[]
private synthetic final static method $values(): SimpleEnum[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
@@ -21,9 +23,11 @@ public final enum class SimpleEnum {
@kotlin.Metadata
public final enum class WithAnnotations {
// source: 'enum.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: WithAnnotations[]
public final enum static @Ann field A: WithAnnotations
public final enum static @Ann field B: WithAnnotations
private synthetic final static method $entries(): WithAnnotations[]
private synthetic final static method $values(): WithAnnotations[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
@@ -34,11 +38,13 @@ public final enum class WithAnnotations {
@kotlin.Metadata
public final enum class WithConstructor {
// source: 'enum.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: WithConstructor[]
public final enum static field A: WithConstructor
public final enum static field B: WithConstructor
public final enum static field C: WithConstructor
private final @org.jetbrains.annotations.NotNull field x: java.lang.String
private synthetic final static method $entries(): WithConstructor[]
private synthetic final static method $values(): WithConstructor[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int, p2: java.lang.String): void
@@ -58,9 +64,11 @@ final class WithEntryClass$A {
@kotlin.Metadata
public abstract enum class WithEntryClass {
// source: 'enum.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: WithEntryClass[]
public final enum static field A: WithEntryClass
final inner class WithEntryClass$A
private synthetic final static method $entries(): WithEntryClass[]
private synthetic final static method $values(): WithEntryClass[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int): void
@@ -30,9 +30,11 @@ public class TestBasic {
@kotlin.Metadata
public final enum class TestEnum {
// source: 'inlineClassTypeParametersInConstructor.kt'
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private synthetic final static field $VALUES: TestEnum[]
public final enum static field ANSWER: TestEnum
private final field z: int
private synthetic final static method $entries(): TestEnum[]
private synthetic final static method $values(): TestEnum[]
static method <clinit>(): void
private method <init>(p0: java.lang.String, p1: int, p2: int): void
@@ -7,10 +7,12 @@ public final enum class A$B$C {
public final enum static field C2: A$B$C
public final enum static field C3: A$B$C
private synthetic final static field $VALUES: A$B$C[]
private synthetic final static field $ENTRIES: kotlin.enums.EnumEntries
private method <init>(p0: java.lang.String, p1: int): void
public static method values(): A$B$C[]
public static method valueOf(p0: java.lang.String): A$B$C
private synthetic final static method $values(): A$B$C[]
private synthetic final static method $entries(): A$B$C[]
static method <clinit>(): void
}
@@ -1,37 +1,37 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.8. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.9. This declaration is only supported since Kotlin 42.33
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.9
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.9
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.8. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.9. This declaration is only supported since Kotlin 42.33
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.9
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.9
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.8. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.9. This declaration is only supported since Kotlin 42.33
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.9
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.9
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.8. This declaration is only supported since Kotlin 42.33
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.9. This declaration is only supported since Kotlin 42.33
return p
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.9
return p
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.9
return p
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.9
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.9
a.f()
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.9
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.9
a.f()
^
COMPILATION_ERROR
@@ -1,7 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.9
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.8
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.9
a.f()
^
COMPILATION_ERROR
@@ -1,24 +1,25 @@
error: incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
$TMP_DIR$/library.jar!/META-INF/main.kotlin_module: error: module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is $ABI_VERSION$.
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:3:13: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 1.9.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:3:13: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
The class is loaded from $TMP_DIR$/library.jar!/a/C.class
fun test(c: C) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:4:5: error: unresolved reference: f
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:4:5: error: class 'a.AKt' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
The class is loaded from $TMP_DIR$/library.jar!/a/AKt.class
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:5:5: error: unresolved reference: v
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:5:5: error: class 'a.AKt' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
The class is loaded from $TMP_DIR$/library.jar!/a/AKt.class
v
^
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:6:5: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 1.9.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:6:5: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
The class is loaded from $TMP_DIR$/library.jar!/a/C.class
c.let { C() }
^
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:6:7: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 1.9.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:6:7: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
The class is loaded from $TMP_DIR$/library.jar!/a/C.class
c.let { C() }
^
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:6:13: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 1.9.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
compiler/testData/compileKotlinAgainstCustomBinaries/strictMetadataVersionSemanticsOldVersion/source.kt:6:13: error: class 'a.C' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.0.0, but the compiler version $ABI_VERSION$ can read versions up to $ABI_VERSION$.
The class is loaded from $TMP_DIR$/library.jar!/a/C.class
c.let { C() }
^
@@ -15,13 +15,13 @@ val z = 3
fun foo(x: Int = <!UNINITIALIZED_PARAMETER!>y<!>, y: Int = x, i : Int = z): Int = x + y
fun foo(x: () -> Int = { <!UNINITIALIZED_PARAMETER_WARNING!>y<!> }, y: Int = x(), i : Int = z): Int = x() + y
fun foo(x: () -> Int = { <!UNINITIALIZED_PARAMETER!>y<!> }, y: Int = x(), i : Int = z): Int = x() + y
fun bar(x: () -> Int = { <!UNINITIALIZED_PARAMETER_WARNING!>y<!>; 1 }, y: Int) {}
fun bar(x: () -> Int = { <!UNINITIALIZED_PARAMETER!>y<!>; 1 }, y: Int) {}
fun baz(
x: () -> Int = {
fun bar(xx: () -> Int = { <!UNINITIALIZED_PARAMETER_WARNING!>y<!>; 1 }) = xx
fun bar(xx: () -> Int = { <!UNINITIALIZED_PARAMETER!>y<!>; 1 }) = xx
bar()()
},
y: Int
@@ -30,7 +30,7 @@ fun baz(
fun boo(
x: () -> Int = {
fun bar(): Int = <!UNINITIALIZED_PARAMETER_WARNING!>y<!>
fun bar(): Int = <!UNINITIALIZED_PARAMETER!>y<!>
bar()
},
y: Int
@@ -7,7 +7,7 @@ fun foo(a: (String) -> Unit) {
interface A : (String) -> Unit {}
typealias AliasedEFT = ExtensionFunctionType
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE_WARNING!>@AliasedEFT<!> A) {
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE!>@AliasedEFT<!> A) {
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
// Only kotlin.Function{n} type annotated with @Extension should
"".a()
@@ -7,7 +7,7 @@ fun foo(a: (String) -> Unit) {
interface A : (String) -> Unit {}
typealias AliasedEFT = ExtensionFunctionType
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE_WARNING!>@AliasedEFT<!> A) {
fun foo(a: <!WRONG_EXTENSION_FUNCTION_TYPE!>@AliasedEFT<!> A) {
// @Extension annotation on an unrelated type shouldn't have any effect on this diagnostic.
// Only kotlin.Function{n} type annotated with @Extension should
"".<!UNRESOLVED_REFERENCE!>a<!>()
@@ -1,43 +0,0 @@
// WITH_STDLIB
fun <E> SmartList(x: E) {}
fun <E> SmartList(x: Collection<E>) {}
fun append(x: Any?) {}
fun append(x: Collection<*>) {}
fun append2(x: Iterable<*>) {}
fun append2(x: Collection<*>) {}
class In<in T>(x: T)
@JvmName("append31")
fun append3(x: In<Nothing>) {}
fun append3(x: In<Collection<*>>) {}
fun <E> append4(x: E) {}
fun <E: Collection<*>> append4(x: E) {}
fun <T> takes(range: T) {}
fun <T> takes(range: T) where T : Collection<*>, T: ClosedRange<*> {}
fun main() {
SmartList(1..2) // warning
SmartList<IntRange>(1..10) // no warning
append(1..10) // warning
append((1..10) as Any) // no warning
append((1..10) as Iterable<Int>) // no warning
append("a".."z") // no warning, the range is not iterable
append(1.0..2.0)
append2(1..10) // no warning
append3(In(1..10)) // no warning
append4(1..10) // warning
append4<IntRange>(1..10) // warning
takes(1..10) // warning
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// WITH_STDLIB
fun <E> SmartList(x: E) {}
@@ -22,10 +23,10 @@ fun <T> takes(range: T) {}
fun <T> takes(range: T) where T : Collection<*>, T: ClosedRange<*> {}
fun main() {
SmartList(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..2<!>) // warning
SmartList(1..2) // warning
SmartList<IntRange>(1..10) // no warning
append(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
append(1..10) // warning
append((1..10) as Any) // no warning
append((1..10) as Iterable<Int>) // no warning
append("a".."z") // no warning, the range is not iterable
@@ -35,9 +36,9 @@ fun main() {
append3(In(1..10)) // no warning
append4(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
append4(1..10) // warning
append4<IntRange>(1..10) // warning
takes(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
takes(1..10) // warning
}
@@ -1,37 +0,0 @@
// WITH_STDLIB
// !LANGUAGE: +ProgressionsChangingResolve
fun <E> SmartList(x: E) {}
fun <E> SmartList(x: Collection<E>) {}
fun append(x: Any?) {}
fun append(x: Collection<*>) {}
fun append2(x: Iterable<*>) {}
fun append2(x: Collection<*>) {}
class In<in T>(x: T)
@JvmName("append31")
fun append3(x: In<Nothing>) {}
fun append3(x: In<Collection<*>>) {}
fun <E> append4(x: E) {}
fun <E: Collection<*>> append4(x: E) {}
fun main() {
SmartList(1..2) // warning
SmartList<IntRange>(1..10) // no warning
append(1..10) // warning
append((1..10) as Any) // no warning
append((1..10) as Iterable<Int>) // no warning
append("a".."z") // no warning, the range is not iterable
append(1.0..2.0)
append2(1..10) // no warning
append3(In(1..10)) // no warning
append4(1..10) // warning
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// WITH_STDLIB
// !LANGUAGE: +ProgressionsChangingResolve
@@ -20,10 +21,10 @@ fun <E> append4(x: E) {}
fun <E: Collection<*>> append4(x: E) {}
fun main() {
SmartList(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR("fun <E> SmartList(x: Collection<E>): Unit")!>1..2<!>) // warning
SmartList(1..2) // warning
SmartList<IntRange>(1..10) // no warning
append(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR("fun append(x: Collection<*>): Unit")!>1..10<!>) // warning
append(1..10) // warning
append((1..10) as Any) // no warning
append((1..10) as Iterable<Int>) // no warning
append("a".."z") // no warning, the range is not iterable
@@ -33,5 +34,5 @@ fun main() {
append3(In(1..10)) // no warning
append4(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR("fun <E : Collection<*>> append4(x: E): Unit")!>1..10<!>) // warning
append4(1..10) // warning
}
@@ -1,53 +0,0 @@
// WITH_STDLIB
// FULL_JDK
// FILE: JavaSmartList.java
import kotlin.ranges.ClosedRange;
import java.util.Collection;
public class JavaSmartList <E> {
JavaSmartList(E x) {}
JavaSmartList(Collection<E> x) {}
static void append(Object x) {}
static void append(Collection<?> x) {}
static void append2(Iterable<?> x) {}
static void append2(Collection<?> x) {}
public static class In <T> {
In(T x) {}
}
static void append3(In<?> x) {}
static void append3(In<Collection<?>> x) {}
static <E> void append4(E x) {}
static <E extends Collection<?>> void append4(E x) {}
static <T> void takes(T x) {}
static <T extends Collection<?> & ClosedRange<?>> void takes(T x) {}
}
// FILE: main.kt
fun main() {
JavaSmartList(1..2) // warning
JavaSmartList<IntRange>(1..10) // no warning
JavaSmartList.append(1..10) // warning
JavaSmartList.append((1..10) as Any) // no warning
JavaSmartList.append((1..10) as Iterable<Int>) // no warning
JavaSmartList.append("a".."z") // no warning, the range is not iterable
JavaSmartList.append(1.0..2.0)
JavaSmartList.append2(1..10) // no warning
JavaSmartList.append3(JavaSmartList.In(1..10)) // no warning
JavaSmartList.append4(1..10) // warning
JavaSmartList.append4<IntRange>(1..10) // warning
JavaSmartList.takes(1..10) // warning
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// WITH_STDLIB
// FULL_JDK
@@ -32,10 +33,10 @@ public class JavaSmartList <E> {
// FILE: main.kt
fun main() {
JavaSmartList(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..2<!>) // warning
JavaSmartList(1..2) // warning
JavaSmartList<IntRange>(1..10) // no warning
JavaSmartList.append(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
JavaSmartList.append(1..10) // warning
JavaSmartList.append((1..10) as Any) // no warning
JavaSmartList.append((1..10) as Iterable<Int>) // no warning
JavaSmartList.append("a".."z") // no warning, the range is not iterable
@@ -45,9 +46,9 @@ fun main() {
JavaSmartList.append3(JavaSmartList.In(1..10)) // no warning
JavaSmartList.append4(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
JavaSmartList.append4(1..10) // warning
JavaSmartList.append4<IntRange>(1..10) // warning
JavaSmartList.takes(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
JavaSmartList.takes(1..10) // warning
}
@@ -1,7 +1,7 @@
// SKIP_TXT
enum class A(val z: Any) {
Y(<!UNINITIALIZED_ENUM_COMPANION_WARNING, UNINITIALIZED_VARIABLE!>x<!>);
Y(<!UNINITIALIZED_ENUM_COMPANION, UNINITIALIZED_VARIABLE!>x<!>);
companion object {
val x = A.Y.ordinal
@@ -9,7 +9,7 @@ enum class A(val z: Any) {
}
enum class B(val z: Any) {
Y(<!UNINITIALIZED_ENUM_COMPANION_WARNING!>B<!>.x);
Y(<!UNINITIALIZED_ENUM_COMPANION!>B<!>.x);
companion object {
val x = B.Y.ordinal
@@ -9,7 +9,7 @@ enum class B(val x: Int) {
}
enum class C(val x: Int) {
C1(<!UNINITIALIZED_ENUM_COMPANION_WARNING, UNINITIALIZED_VARIABLE!>SUM<!>),
C1(<!UNINITIALIZED_ENUM_COMPANION, UNINITIALIZED_VARIABLE!>SUM<!>),
C2(1);
companion object {
@@ -32,8 +32,8 @@ enum class Fruit(personal: Int) {
// Another example from KT-11769
enum class EnumCompanion1(val x: Int) {
INSTANCE(<!UNINITIALIZED_ENUM_COMPANION, UNINITIALIZED_ENUM_COMPANION_WARNING!>Companion<!>.foo()),
ANOTHER(<!UNINITIALIZED_ENUM_COMPANION_WARNING!>foo()<!>);
INSTANCE(<!UNINITIALIZED_ENUM_COMPANION!>Companion<!>.foo()),
ANOTHER(<!UNINITIALIZED_ENUM_COMPANION!>foo()<!>);
companion object {
fun foo() = 42
@@ -41,7 +41,7 @@ enum class EnumCompanion1(val x: Int) {
}
// Also should be reported for implicit receiver
enum class EnumCompanion2(val x: Int) {
INSTANCE(<!UNINITIALIZED_ENUM_COMPANION_WARNING!><!UNINITIALIZED_ENUM_COMPANION!>foo<!>()<!>);
INSTANCE(<!UNINITIALIZED_ENUM_COMPANION!>foo()<!>);
companion object {
fun foo() = 42
@@ -4,7 +4,7 @@
object DelegateTest {
var result = ""
val f by lazy {
result += <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING!>f<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>toString<!>() // Compiler crash
result += <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>f<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>toString<!>() // Compiler crash
"hello"
}
}
@@ -12,7 +12,7 @@ object DelegateTest {
object DelegateTest2 {
var result = ""
val f by lazy {
result += <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING!>f<!>
result += <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>f<!>
"hello"
}
}
@@ -3,12 +3,12 @@
import kotlin.reflect.KProperty
val a by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING!>a<!>
val a by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>a<!>
val b by Delegate(<!DEBUG_INFO_MISSING_UNRESOLVED, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>b<!>)
val c by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, UNINITIALIZED_VARIABLE!>d<!>
val d by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING!>c<!>
val d by <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>c<!>
class Delegate(i: Int) {
operator fun getValue(t: Any?, p: KProperty<*>): Int {
+1 -1
View File
@@ -3,7 +3,7 @@
object DelegateTest {
var result = ""
val f by lazy {
result += <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING!>f<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>toString<!>() // Compiler crash
result += <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE, TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>f<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>toString<!>() // Compiler crash
"hello"
}
}
@@ -1,3 +1,3 @@
package typeReferenceError
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Pair<!><<!SYNTAX!><!>:(<!UNSUPPORTED!>val<!> <!UNSUPPORTED!>c<!>: <!SYNTAX!><!SYNTAX!><!>fun<!><!SYNTAX!><!> <!UNRESOLVED_REFERENCE!>main<!><!NO_CONSTRUCTOR_WARNING!>()<!>
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class Pair<!><<!SYNTAX!><!>:(<!UNSUPPORTED!>val<!> <!UNSUPPORTED!>c<!>: <!SYNTAX!><!SYNTAX!><!>fun<!><!SYNTAX!><!> <!UNRESOLVED_REFERENCE!>main<!><!NO_CONSTRUCTOR!>()<!>
@@ -1,12 +1,4 @@
/kt47986Default.kt:4:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986Default.kt:6:20: warning: parameter 'x' is never used
fun <K> Foo<K>.bar(x: Int = 1) {}
^
/kt47986Default.kt:9:9: warning: variable 'x' is never used
val x = buildFoo {
^
/kt47986Default.kt:9:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
/kt47986Default.kt:10:13: error: not enough information to infer type variable K
val x = buildFoo {
^
@@ -1,12 +0,0 @@
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<K>
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
fun <K> Foo<K>.bar(x: Int = 1) {}
fun main() {
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
bar()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<K>
@@ -6,7 +7,7 @@ fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
fun <K> Foo<K>.bar(x: Int = 1) {}
fun main() {
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> {
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
bar()
}
}
@@ -1,12 +1,4 @@
/kt47986_2.kt:4:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986_2.kt:11:9: warning: variable 'x' is never used
val x = buildFoo { // can't infer
^
/kt47986_2.kt:11:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
/kt47986_2.kt:12:13: error: not enough information to infer type variable K
val x = buildFoo { // can't infer
^
/kt47986_2.kt:12:13: warning: variable 'y' is never used
val y = id(::bar)
^
@@ -1,14 +0,0 @@
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<K>
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
fun <L> Foo<L>.bar() {}
fun <K> id(x: K) = x
fun main() {
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> { // can't infer
val y = id(::bar)
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<K>
@@ -8,7 +9,7 @@ fun <L> Foo<L>.bar() {}
fun <K> id(x: K) = x
fun main() {
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> { // can't infer
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> { // can't infer
val y = id(::bar)
}
}
@@ -1,12 +1,4 @@
/kt47986_3.kt:4:18: warning: parameter 'builderAction' is never used
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
^
/kt47986_3.kt:6:26: warning: parameter 'x' is never used
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
^
/kt47986_3.kt:9:9: warning: variable 'x' is never used
val x = buildFoo {
^
/kt47986_3.kt:9:13: warning: type parameter for a type argument K can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
/kt47986_3.kt:10:13: error: not enough information to infer type variable K
val x = buildFoo {
^
@@ -1,12 +0,0 @@
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<K>
fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
fun main() {
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
bar()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !RENDER_DIAGNOSTICS_FULL_TEXT
class Foo<K>
@@ -6,7 +7,7 @@ fun <K> buildFoo(builderAction: Foo<K>.() -> Unit): Foo<K> = Foo()
fun <K: N, N> Foo<K>.bar(x: Int = 1) {}
fun main() {
val x = <!INFERRED_INTO_DECLARED_UPPER_BOUNDS!>buildFoo<!> {
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>buildFoo<!> {
bar()
}
}
@@ -1,12 +1,4 @@
/kt51464.kt:2:16: warning: parameter 'value' is never used
fun <T> flowOf(value: T): Flow<T> = TODO()
^
/kt51464.kt:8:30: warning: parameter 'transform' is never used
fun <T, R> Flow<T>.transform(transform: FlowCollector<R>.(T) -> Unit): Flow<R> = TODO()
^
/kt51464.kt:11:20: warning: parameter 'collector' is never used
fun <T> doEmit(collector: FlowCollector<T>) {}
^
/kt51464.kt:12:15: warning: type parameter for a type argument R can't be inferred into declared upper bounds. Please provide any use-site type information. It will become an error in future releases.
/kt51464.kt:13:15: error: not enough information to infer type variable R
flowOf(1).transform { doEmit(this) }
^

Some files were not shown because too many files have changed in this diff Show More