You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importscala.scalajs.js@js.annotation.JSGlobal("a")
@js.native
defstring:String= js.native // ok@js.annotation.JSGlobal("a")
@js.native
defa:"a"= js.native // error: The type of a must be explicitly specified because it is JS native.// same with `var`/`val`
Output
The type of a must be explicitly specified because it is JS native.
Expectation
The type is specified, so it should be accepted.
I see this in the implementation of the check:
if (tree.tpt.span.isSynthetic)
report.error(i"The type of ${tree.name} must be explicitly specified because it is JS native.", tree)
Perhaps it is the case that the literal type tree is considered synthetic somehow?
The text was updated successfully, but these errors were encountered:
Compiler version
3.2.0
Minimized code
Output
Expectation
The type is specified, so it should be accepted.
I see this in the implementation of the check:
Perhaps it is the case that the literal type tree is considered synthetic somehow?
The text was updated successfully, but these errors were encountered: