K2: implement BUILDER_INFERENCE_STUB_RECEIVER
#KT-59369 Fixed
This commit is contained in:
committed by
Space Team
parent
5e5e5b8b9f
commit
0ed6256bcc
+19
@@ -0,0 +1,19 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
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()<!> }
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
|
||||
Reference in New Issue
Block a user