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
compiles and generates proper JavaScript, but it should fail like this:
scala>newL.Opt { vala="a" }
<console>:13:error: overriding value a in classOpt$class of typeString;
value a needs `override' modifiernewL.Opt { vala="a" }
I thought that simple c.typeCheck(...) in jsAnonObjDecl will fix this, but apparently this doesn't work (it still type checks).
The text was updated successfully, but these errors were encountered:
That's an interesting one. As @xeno_by explained that's because Scala checks overriding during refchecks phase, which apparently is executed after macro expansion. And as after javascript macro expansion there is no original Scala code which should not compile - the original code compiles.
As a solution it's recommended to keep original Scala code after expansion. I'll implement it a bit later.
I was hoping for a (relatively) type safe and lightweight way of providing options to JavaScript APIs. Suppose we have:
Then the following:
compiles and generates proper JavaScript, but it should fail like this:
I thought that simple
c.typeCheck(...)
injsAnonObjDecl
will fix this, but apparently this doesn't work (it still type checks).The text was updated successfully, but these errors were encountered: