```class Test( val test: () -> Unit // for Jvm a...
# compiler
p
Copy code
class Test(
  val test: () -> Unit // for Jvm and WasmJs it is ok, for Js it is name collision with fun test
) {
  fun test() {
    test.invoke()
  }
}
Why not to keep consistency across all platforms - make mangling for Js platform or forbid for all platforms. It increases complexity when adding new platform to existing projects. For mangling case, if someone need to keep name for Js, for example, he can use JsExport annotation.
a
Hi Paul. I'm so sorry for such frustration we've introduced. The issue has been fixed just recently, and there will be no such kind of limitations for not exported classes in 2.2.20: https://youtrack.jetbrains.com/issue/KT-55256/ P.S. It was a bug in our checker and not something intentional.
thank you color 1