Migrate some KT-65789 & KT-58920 tests on using take<ExpectedType>(arg)
This commit is contained in:
committed by
Space Team
parent
0f53ee64d6
commit
f656a9fdc6
-62
@@ -1,62 +0,0 @@
|
||||
FILE: constructorVsCompanionMember.kt
|
||||
package bar
|
||||
|
||||
public final class Owner : R|kotlin/Any| {
|
||||
public constructor(): R|bar/Owner| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
private constructor(): R|bar/Owner.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final fun Foo(string: R|kotlin/String?|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final class Foo : R|kotlin/Any| {
|
||||
public constructor(str: R|kotlin/String|): R|bar/Owner.Companion.Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val str: R|kotlin/String| = R|<local>/str|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
|
||||
public final fun Bar(string: R|kotlin/String|): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final class Bar : R|kotlin/Any| {
|
||||
public constructor(str: R|kotlin/String?|): R|bar/Owner.Companion.Bar| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val str: R|kotlin/String?| = R|<local>/str|
|
||||
public get(): R|kotlin/String?|
|
||||
|
||||
}
|
||||
|
||||
public final val foo: R|kotlin/Unit| = this@R|bar/Owner.Companion|.R|bar/Owner.Companion.Foo|(String(1))
|
||||
public get(): R|kotlin/Unit|
|
||||
|
||||
public final val bar: R|kotlin/Unit| = this@R|bar/Owner.Companion|.R|bar/Owner.Companion.Bar|(String(2))
|
||||
public get(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
|
||||
public final val foo: R|bar/Owner.Companion.Foo| = R|bar/Owner.Companion.Foo.Foo|(String(3))
|
||||
public get(): R|bar/Owner.Companion.Foo|
|
||||
|
||||
public final val bar: R|bar/Owner.Companion.Bar| = R|bar/Owner.Companion.Bar.Bar|(String(4))
|
||||
public get(): R|bar/Owner.Companion.Bar|
|
||||
|
||||
}
|
||||
public final val ownerFoo: R|kotlin/Unit| = Q|bar/Owner|.R|bar/Owner.Companion.Foo|(String(1))
|
||||
public get(): R|kotlin/Unit|
|
||||
public final val ownerCompanionFoo: R|bar/Owner.Companion.Foo| = Q|bar/Owner.Companion|.R|bar/Owner.Companion.Foo.Foo|(String(2))
|
||||
public get(): R|bar/Owner.Companion.Foo|
|
||||
public final val ownerBar: R|kotlin/Unit| = Q|bar/Owner|.R|bar/Owner.Companion.Bar|(String(3))
|
||||
public get(): R|kotlin/Unit|
|
||||
public final val ownerCompanionBar: R|bar/Owner.Companion.Bar| = Q|bar/Owner.Companion|.R|bar/Owner.Companion.Bar.Bar|(String(4))
|
||||
public get(): R|bar/Owner.Companion.Bar|
|
||||
+10
-9
@@ -1,10 +1,11 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-65789
|
||||
// DIAGNOSTICS: -DEBUG_INFO_LEAKING_THIS
|
||||
// FIR_DUMP
|
||||
|
||||
package bar
|
||||
|
||||
fun <T> take(arg: T): T = arg
|
||||
|
||||
class Owner {
|
||||
companion object {
|
||||
|
||||
@@ -16,16 +17,16 @@ class Owner {
|
||||
|
||||
class Bar(val str: String?)
|
||||
|
||||
val foo = Foo("1") // K1/K2: function
|
||||
val bar = Bar("2") // K1/K2: function
|
||||
val foo = take<Unit>(Foo("1"))
|
||||
val bar = take<Unit>(Bar("2"))
|
||||
}
|
||||
|
||||
val foo = Foo("3") // K1/K2: constructor
|
||||
val bar = Bar("4") // K1/K2: constructor
|
||||
val foo = take<Owner.Companion.Foo>(Foo("3"))
|
||||
val bar = take<Owner.Companion.Bar>(Bar("4"))
|
||||
}
|
||||
|
||||
val ownerFoo = Owner.Foo("1") // K1/K2: function
|
||||
val ownerCompanionFoo = Owner.Companion.Foo("2") // K1/K2: constructor
|
||||
val ownerFoo = take<Unit>(Owner.Foo("1"))
|
||||
val ownerCompanionFoo = take<Owner.Companion.Foo>(Owner.Companion.Foo("2"))
|
||||
|
||||
val ownerBar = Owner.Bar("3") // K1/K2: function
|
||||
val ownerCompanionBar = Owner.Companion.Bar("4") // K1/K2: constructor
|
||||
val ownerBar = take<Unit>(Owner.Bar("3"))
|
||||
val ownerCompanionBar = take<Owner.Companion.Bar>(Owner.Companion.Bar("4"))
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
package
|
||||
|
||||
package bar {
|
||||
public val ownerBar: kotlin.Unit
|
||||
public val ownerCompanionBar: bar.Owner.Companion.Bar
|
||||
public val ownerCompanionFoo: bar.Owner.Companion.Foo
|
||||
public val ownerFoo: kotlin.Unit
|
||||
|
||||
public final class Owner {
|
||||
public constructor Owner()
|
||||
public final val bar: bar.Owner.Companion.Bar
|
||||
public final val foo: bar.Owner.Companion.Foo
|
||||
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
|
||||
|
||||
public companion object Companion {
|
||||
private constructor Companion()
|
||||
public final val bar: kotlin.Unit
|
||||
public final val foo: kotlin.Unit
|
||||
public final fun Bar(/*0*/ string: kotlin.String): kotlin.Unit
|
||||
public final fun Foo(/*0*/ string: kotlin.String?): kotlin.Unit
|
||||
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
|
||||
|
||||
public final class Bar {
|
||||
public constructor Bar(/*0*/ str: kotlin.String?)
|
||||
public final val str: kotlin.String?
|
||||
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
|
||||
}
|
||||
|
||||
public final class Foo {
|
||||
public constructor Foo(/*0*/ str: kotlin.String)
|
||||
public final val str: kotlin.String
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-4
@@ -1,6 +1,10 @@
|
||||
// ISSUE: KT-65789
|
||||
// ISSUE: KT-65789, KT-58920
|
||||
// LANGUAGE: -PrioritizedEnumEntries
|
||||
// FIR_DUMP
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun <T> take(arg: T): T = arg
|
||||
|
||||
enum class SomeClass {
|
||||
FIRST, LAST;
|
||||
@@ -15,5 +19,6 @@ enum class SomeClass {
|
||||
|
||||
val resultValues = SomeClass.<!OVERLOAD_RESOLUTION_AMBIGUITY!>values<!>()
|
||||
val resultValuesRef = SomeClass::<!OVERLOAD_RESOLUTION_AMBIGUITY!>values<!>
|
||||
val resultEntries = <!DEPRECATED_ACCESS_TO_ENTRIES_AS_QUALIFIER!>SomeClass.entries<!>
|
||||
val resultEntriesRef = SomeClass::<!DEPRECATED_ACCESS_TO_ENUM_ENTRY_PROPERTY_AS_REFERENCE!>entries<!>
|
||||
|
||||
val resultEntries = take<SomeClass.entries.Companion>(<!DEPRECATED_ACCESS_TO_ENTRIES_AS_QUALIFIER!>SomeClass.entries<!>)
|
||||
val resultEntriesRef = take<KFunction0<SomeClass.entries>>(SomeClass::entries)
|
||||
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
FILE: constructorVsSyntheticValues.fir.kt
|
||||
public final enum class SomeClass : R|kotlin/Enum<SomeClass>| {
|
||||
private constructor(): R|SomeClass| {
|
||||
super<R|kotlin/Enum<SomeClass>|>()
|
||||
}
|
||||
|
||||
public final static enum entry FIRST: R|SomeClass|
|
||||
public final static enum entry LAST: R|SomeClass|
|
||||
public final class values : R|kotlin/Any| {
|
||||
public constructor(): R|SomeClass.values| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
private constructor(): R|SomeClass.values.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final class entries : R|kotlin/Any| {
|
||||
public constructor(): R|SomeClass.entries| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final companion object Companion : R|kotlin/Any| {
|
||||
private constructor(): R|SomeClass.entries.Companion| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public final static fun values(): R|kotlin/Array<SomeClass>| {
|
||||
}
|
||||
|
||||
public final static fun valueOf(value: R|kotlin/String|): R|SomeClass| {
|
||||
}
|
||||
|
||||
public final static val entries: R|kotlin/enums/EnumEntries<SomeClass>|
|
||||
public get(): R|kotlin/enums/EnumEntries<SomeClass>|
|
||||
|
||||
}
|
||||
public final val resultValues: <ERROR TYPE REF: Ambiguity: values, [/SomeClass.values, /SomeClass.values.values]> = Q|SomeClass|.<Ambiguity: values, [/SomeClass.values, /SomeClass.values.values]>#()
|
||||
public get(): <ERROR TYPE REF: Ambiguity: values, [/SomeClass.values, /SomeClass.values.values]>
|
||||
public final val resultValuesRef: <ERROR TYPE REF: Ambiguity: values, [/SomeClass.values, /SomeClass.values.values]> = Q|SomeClass|::<Ambiguity: values, [/SomeClass.values, /SomeClass.values.values]>#
|
||||
public get(): <ERROR TYPE REF: Ambiguity: values, [/SomeClass.values, /SomeClass.values.values]>
|
||||
public final val resultEntries: R|SomeClass.entries.Companion| = Q|SomeClass.entries|
|
||||
public get(): R|SomeClass.entries.Companion|
|
||||
public final val resultEntriesRef: R|kotlin/reflect/KFunction0<SomeClass.entries>| = Q|SomeClass|::R|/SomeClass.entries.entries|
|
||||
public get(): R|kotlin/reflect/KFunction0<SomeClass.entries>|
|
||||
+9
-4
@@ -1,6 +1,10 @@
|
||||
// ISSUE: KT-65789
|
||||
// ISSUE: KT-65789, KT-58920
|
||||
// LANGUAGE: -PrioritizedEnumEntries
|
||||
// FIR_DUMP
|
||||
// WITH_REFLECT
|
||||
|
||||
import kotlin.reflect.*
|
||||
|
||||
fun <T> take(arg: T): T = arg
|
||||
|
||||
enum class SomeClass {
|
||||
FIRST, LAST;
|
||||
@@ -15,5 +19,6 @@ enum class SomeClass {
|
||||
|
||||
val resultValues = SomeClass.<!OVERLOAD_RESOLUTION_AMBIGUITY!>values<!>()
|
||||
val resultValuesRef = SomeClass::<!OVERLOAD_RESOLUTION_AMBIGUITY!>values<!>
|
||||
val resultEntries = SomeClass.entries
|
||||
val resultEntriesRef = SomeClass::entries
|
||||
|
||||
val resultEntries = take<SomeClass.entries.Companion>(SomeClass.entries)
|
||||
val resultEntriesRef = take<KFunction0<SomeClass.entries>>(SomeClass::entries)
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// ISSUE: KT-65789
|
||||
// ISSUE: KT-65789, KT-58920
|
||||
// LANGUAGE: +PrioritizedEnumEntries
|
||||
// FIR_DUMP
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// ISSUE: KT-65789
|
||||
// ISSUE: KT-65789, KT-58920
|
||||
// LANGUAGE: +PrioritizedEnumEntries
|
||||
// FIR_DUMP
|
||||
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
FILE: Foo.kt
|
||||
package bar
|
||||
|
||||
public final fun Foo(string: R|kotlin/String?|): R|kotlin/Unit| {
|
||||
}
|
||||
public final class Foo : R|kotlin/Any| {
|
||||
public constructor(str: R|kotlin/String|): R|bar/Foo| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val str: R|kotlin/String| = R|<local>/str|
|
||||
public get(): R|kotlin/String|
|
||||
|
||||
}
|
||||
public final val foo: R|bar/Foo| = R|bar/Foo.Foo|(String(1))
|
||||
public get(): R|bar/Foo|
|
||||
public final val barFoo: R|bar/Foo| = Q|bar|.R|bar/Foo.Foo|(String(2))
|
||||
public get(): R|bar/Foo|
|
||||
FILE: another.kt
|
||||
package foo
|
||||
|
||||
public final val foo: R|bar/Foo| = R|bar/Foo.Foo|(String(3))
|
||||
public get(): R|bar/Foo|
|
||||
+6
-4
@@ -1,20 +1,22 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-65789
|
||||
// FIR_DUMP
|
||||
|
||||
// FILE: Foo.kt
|
||||
package bar
|
||||
|
||||
fun <T> take(arg: T): T = arg
|
||||
|
||||
fun Foo(string: String?) {}
|
||||
|
||||
class Foo(val str: String)
|
||||
|
||||
val foo = Foo("1")
|
||||
val barFoo = bar.Foo("2")
|
||||
val foo = take<Foo>(Foo("1"))
|
||||
val barFoo = take<Foo>(bar.Foo("2"))
|
||||
|
||||
// FILE: another.kt
|
||||
package foo
|
||||
|
||||
import bar.Foo
|
||||
import bar.take
|
||||
|
||||
val foo = Foo("3")
|
||||
val foo = take<Foo>(Foo("3"))
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package
|
||||
|
||||
package bar {
|
||||
public val barFoo: bar.Foo
|
||||
public val foo: bar.Foo
|
||||
public fun Foo(/*0*/ string: kotlin.String?): kotlin.Unit
|
||||
|
||||
public final class Foo {
|
||||
public constructor Foo(/*0*/ str: kotlin.String)
|
||||
public final val str: kotlin.String
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
package foo {
|
||||
public val foo: bar.Foo
|
||||
}
|
||||
Reference in New Issue
Block a user