The context parameters preview in 2.1.20 seems ver...
# compiler
y
The context parameters preview in 2.1.20 seems very confused about contexts in the presence of an extension receiver for suspend functions in Kotlin/JS:
Copy code
context(u: Unit, s: String)
public suspend fun Int.foo() {
  println(this)
  println(u)
  println(s)
} // Prints s\nkotlin.Unit\nkotlin.Unit
Removing
suspend
makes it behave as expected. Should I report on YouTrack or not since this is a prototype technically
p
There are some known issues in 2.1.20 context implementation in JS/Native, some of them are already fixed in 2.2.0-Beta1 branch. It's fine to report it, so we can ensure, this is also fixed (I expect it to be, but didn't check).
y
That branch is not out yet, correct?
p
No, it's not.
y
🙏 1
m
Off topic but do context parameters work for you in the IDE? For me it shows a syntax error:/
p
It's still work in progress. Most things work if in K2 mode in latest EAP at least.
m
Thank you
y
Using 2025.1 Beta IDEA works just fine!
👍 1