-
Notifications
You must be signed in to change notification settings - Fork 86
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Hello!
While introducing context parameters in my code, I noticed that ktfmt is not able to handle them on properties (at least properties in classes/interfaces, global scope seems to work for some reason).
Two possible errors are raised:
0
context(Unit)
val someOuterProp: String get() = ""
This is fine.
I use Unit
for simplicity's sake, but "real" interfaces exhibit the same behavior.
1
Simple property with context parameter:
interface SomeInterface {
context(Unit)
val someInnerProp: String get() = ""
}
error: expected token: 'context'; generated val instead
2
interface BaseInterface {
context(Unit)
open val someInnerProp: String get() = ""
}
interface SomeInterface {
context(Unit)
override val someInnerProp: String get() = ""
}
Both of them can, in isolation, cause this:
error: did not generate token "context"
A related issue I could find is #471, but that pertains to methods, not properties.
If I read the KEEP correctly, these cases should be legal, albeit experimental, Kotlin.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed