kotlin-sublime-package icon indicating copy to clipboard operation
kotlin-sublime-package copied to clipboard

Interfaces without Blocks break the rest of the file until a Block appears

Open phase opened this issue 9 years ago • 1 comments
trafficstars

Interfaces don't require a block, but the highlighter won't highlight correctly until it finds a block for the interface.

interface Test

/**
 * Doc Block Comment
 */
val test = 1

/**
 * asdf
 */
val T_UNDEF = object {
    override fun toString() = "undefined type"
}

/**
 * Another Doc Block Comment
 */
val test2 = 2

With an empty block, everything works normally.

interface Test {}

/**
 * Doc Block Comment
 */
val test = 1

/**
 * asdf
 */
val T_UNDEF = object {
    override fun toString() = "undefined type"
}

/**
 * Another Doc Block Comment
 */
val test2 = 2

phase avatar Oct 30 '16 03:10 phase

Same thing happens with annotation classes without bodies https://github.com/JetBrains/kotlin/blob/master/libraries/kotlin.test/js/src/main/kotlin/kotlin/test/Annotations.kt

ilya-g avatar Sep 14 '17 19:09 ilya-g