https://kotlinlang.org logo
#k2-early-adopters
Title
# k2-early-adopters
a

Ayfri

11/02/2023, 10:44 PM
Just tried K2 on Kore and I get errors on serialized fun interfaces :
Copy code
@Serializable(RecipeType.Companion.RecipeTypeSerializer::class)
fun interface RecipeType {
	override fun toString(): String

	companion object {
		data object RecipeTypeSerializer : ToStringSerializer<RecipeType>() // serializer just using the `.toString()` method, deserialization isn't available
	}
}

object RecipeTypes {
	val BLASTING = RecipeType { "blasting" }
	val CAMPFIRE_COOKING = RecipeType { "campfire_cooking" }
	val CRAFTING_SHAPED = RecipeType { "crafting_shaped" }
    ...
}
The errors I get :
Copy code
Interface '@Serializable(...) fun interface RecipeType : Any' does not have constructors.
On each line of
RecipeType { ... }
Is this issue known, and is there any YouTrack issue about that ?
d

dmitriy.novozhilov

11/03/2023, 5:32 AM
cc @sandwwraith
s

sandwwraith

11/06/2023, 4:51 PM
This doesn't look like something I'm aware of. Do you mind creating a YT ticket with a detailed description?
a

Ayfri

11/06/2023, 9:00 PM
Will do that tomorrow if I have time to !
2 Views