Files
kotlin-fork/compiler/testData/codegen/box/enum/kt44744.kt
T
2021-03-15 17:26:49 +03:00

23 lines
545 B
Kotlin
Vendored

enum class ContentType {
PLAIN_TEXT {
override fun convert(text: String, targetType: ContentType): String {
return text
}
},
MARKDOWN {
override fun convert(text: String, targetType: ContentType): String {
return when (targetType) {
MARKDOWN -> text
PLAIN_TEXT -> ""
}
}
};
abstract fun convert(text: String, targetType: ContentType): String
}
fun box() =
ContentType.PLAIN_TEXT.convert("OK", ContentType.PLAIN_TEXT)