Tech News
← Back to articles

A years-long Turkish alphabet bug in the Kotlin compiler

read original related products more articles

Muhammed Demirbaş couldn’t have been more spot on in his investigation and assessment of the compiler bug. Since Kotlin is open source, he was able to search the compiler’s code for the exact line of code where that “Unknown compiler message tag” string appears:

val qNameLowerCase = qName.toLowerCase()

var category: CompilerMessageSeverity? = CATEGORIES[qNameLowerCase]

if (category == null) {

messageCollector.report(ERROR, "Unknown compiler message tag: $qName")

category = INFO

}

So what does this code do, and why does it sometimes go wrong?

The code is part of a class named CompilerOutputParser , and is responsible for reading XML files containing messages from the Kotlin compiler. Those files look something like this:

... continue reading