K2: Adjust test data after PCLA implementation [green-to-red, controversial]
^KT-59791 In Progress
This commit is contained in:
committed by
Space Team
parent
f945dce4c8
commit
8459465177
+21
@@ -0,0 +1,21 @@
|
||||
// FIR_DUMP
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// ISSUE: KT-64823 (K2/PCLA difference)
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
class TypeDefinition<KotlinType : Any> {
|
||||
fun parse(parser: (serializedValue: String) -> KotlinType?): Unit = TODO()
|
||||
fun serialize(parser: (value: KotlinType) -> Any?): Unit = TODO()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
fun <KotlinType : Any> defineType(definition: TypeDefinition<KotlinType>.() -> Unit): Unit = TODO()
|
||||
|
||||
fun main() {
|
||||
defineType {
|
||||
parse { it.toInt() }
|
||||
serialize { <!BUILDER_INFERENCE_STUB_RECEIVER!>it<!>.toString() }
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
FILE: kt36220.kt
|
||||
FILE: kt36220.fir.kt
|
||||
public final class TypeDefinition<KotlinType : R|kotlin/Any|> : R|kotlin/Any| {
|
||||
public constructor<KotlinType : R|kotlin/Any|>(): R|TypeDefinition<KotlinType>| {
|
||||
super<R|kotlin/Any|>()
|
||||
@@ -22,8 +22,8 @@ FILE: kt36220.kt
|
||||
^ R|<local>/it|.R|kotlin/text/toInt|()
|
||||
}
|
||||
)
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun <anonymous>(it: R|kotlin/Int|): R|kotlin/Any?| <inline=NoInline> {
|
||||
^ (R|<local>/it| as R|kotlin/Any|).R|kotlin/Any.toString|()
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun <anonymous>(it: R|@R|kotlin/ParameterName|(name = String(value)) kotlin/Int|): R|kotlin/Any?| <inline=NoInline> {
|
||||
^ R|<local>/it|.R|kotlin/toString<Inapplicable(RESOLVED_WITH_ERROR): kotlin/toString>#|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// FIR_IDENTICAL
|
||||
// FIR_DUMP
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// ISSUE: KT-64823 (K2/PCLA difference)
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
|
||||
Vendored
+24
@@ -0,0 +1,24 @@
|
||||
// FIR_DUMP
|
||||
// Similar to kt36220.kt, but with receivers instead of it
|
||||
// ISSUE: KT-64823 (K2/PCLA difference)
|
||||
|
||||
class TypeDefinition<KotlinType : Any> {
|
||||
fun parse(parser: (serializedValue: String) -> KotlinType?): Unit = TODO()
|
||||
fun serialize(parser: KotlinType.() -> Any?): Unit = TODO()
|
||||
}
|
||||
|
||||
fun <KotlinType : Any> defineType(definition: TypeDefinition<KotlinType>.() -> Unit): Unit = TODO()
|
||||
|
||||
fun foo() {
|
||||
defineType {
|
||||
parse { it.toInt() }
|
||||
serialize { toString() }
|
||||
}
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
defineType {
|
||||
parse { it.toInt() }
|
||||
serialize { <!CANNOT_INFER_PARAMETER_TYPE!>this<!>.toString() }
|
||||
}
|
||||
}
|
||||
Vendored
+5
-5
@@ -1,4 +1,4 @@
|
||||
FILE: stubCallOnReceiver.kt
|
||||
FILE: stubCallOnReceiver.fir.kt
|
||||
public final class TypeDefinition<KotlinType : R|kotlin/Any|> : R|kotlin/Any| {
|
||||
public constructor<KotlinType : R|kotlin/Any|>(): R|TypeDefinition<KotlinType>| {
|
||||
super<R|kotlin/Any|>()
|
||||
@@ -22,8 +22,8 @@ FILE: stubCallOnReceiver.kt
|
||||
^ R|<local>/it|.R|kotlin/text/toInt|()
|
||||
}
|
||||
)
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun R|kotlin/Int|.<anonymous>(): R|kotlin/Any?| <inline=NoInline> {
|
||||
^ (this@R|special/anonymous| as R|kotlin/Any|).R|kotlin/Any.toString|()
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun <ERROR TYPE REF: Cannot infer type for receiver parameter>.<anonymous>(): R|kotlin/Any?| <inline=NoInline> {
|
||||
^ this@R|special/anonymous|.R|kotlin/toString|()
|
||||
}
|
||||
)
|
||||
}
|
||||
@@ -35,8 +35,8 @@ FILE: stubCallOnReceiver.kt
|
||||
^ R|<local>/it|.R|kotlin/text/toInt|()
|
||||
}
|
||||
)
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun R|kotlin/Int|.<anonymous>(): R|kotlin/Any?| <inline=NoInline> {
|
||||
^ (this@R|special/anonymous| as R|kotlin/Any|).R|kotlin/Any.toString|()
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun <ERROR TYPE REF: Cannot infer type for receiver parameter>.<anonymous>(): R|kotlin/Any?| <inline=NoInline> {
|
||||
^ this@R|special/anonymous|.R|kotlin/toString|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// FIR_IDENTICAL
|
||||
// FIR_DUMP
|
||||
// Similar to kt36220.kt, but with receivers instead of it
|
||||
// ISSUE: KT-64823 (K2/PCLA difference)
|
||||
|
||||
class TypeDefinition<KotlinType : Any> {
|
||||
fun parse(parser: (serializedValue: String) -> KotlinType?): Unit = TODO()
|
||||
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// FIR_DUMP
|
||||
// ISSUE: KT-64823 (K2/PCLA difference)
|
||||
|
||||
class TypeDefinition<KotlinType : Any> {
|
||||
fun parse(parser: (serializedValue: String) -> KotlinType?): Unit = TODO()
|
||||
fun serialize(parser: (value: KotlinType) -> Any?): Unit = TODO()
|
||||
}
|
||||
|
||||
fun <KotlinType : Any> defineType(definition: TypeDefinition<KotlinType>.() -> Unit): Unit = TODO()
|
||||
|
||||
fun main() {
|
||||
defineType {
|
||||
parse { it.toInt() }
|
||||
serialize {
|
||||
val i = it
|
||||
<!BUILDER_INFERENCE_STUB_RECEIVER!>i<!>.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+4
-4
@@ -1,4 +1,4 @@
|
||||
FILE: stubCallOnVariable.kt
|
||||
FILE: stubCallOnVariable.fir.kt
|
||||
public final class TypeDefinition<KotlinType : R|kotlin/Any|> : R|kotlin/Any| {
|
||||
public constructor<KotlinType : R|kotlin/Any|>(): R|TypeDefinition<KotlinType>| {
|
||||
super<R|kotlin/Any|>()
|
||||
@@ -22,9 +22,9 @@ FILE: stubCallOnVariable.kt
|
||||
^ R|<local>/it|.R|kotlin/text/toInt|()
|
||||
}
|
||||
)
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun <anonymous>(it: <ERROR TYPE REF: Cannot infer type for parameter it>): R|kotlin/Any?| <inline=NoInline> {
|
||||
lval i: <ERROR TYPE REF: Cannot infer type for parameter it> = R|<local>/it|
|
||||
^ R|<local>/i|.R|kotlin/toString|()
|
||||
this@R|special/anonymous|.R|SubstitutionOverride</TypeDefinition.serialize: R|kotlin/Unit|>|(<L> = serialize@fun <anonymous>(it: R|@R|kotlin/ParameterName|(name = String(value)) kotlin/Int|): R|kotlin/Any?| <inline=NoInline> {
|
||||
lval i: R|@R|kotlin/ParameterName|(name = String(value)) kotlin/Int| = R|<local>/it|
|
||||
^ R|<local>/i|.R|kotlin/toString<Inapplicable(RESOLVED_WITH_ERROR): kotlin/toString>#|()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// FIR_IDENTICAL
|
||||
// FIR_DUMP
|
||||
// ISSUE: KT-64823 (K2/PCLA difference)
|
||||
|
||||
class TypeDefinition<KotlinType : Any> {
|
||||
fun parse(parser: (serializedValue: String) -> KotlinType?): Unit = TODO()
|
||||
|
||||
Reference in New Issue
Block a user