-
Notifications
You must be signed in to change notification settings - Fork 60
top-level functions pick up a tempCtor
superclass
#90
Comments
This seems like a bug in closure compiler. Looking into the type at runtime, it claims to have kind==CONSTRUCTOR when the |
Ben says |
I didn't know that in closure all functions are newable. TS plain functions are not new-able, so we have to make it explicitly new-able with
|
In Closure,
|
The problem seems to be that the information was lost. Introspecting the type system tells us only that the thing is modelled as a class, but not whether it was declared with @constructor. |
Can we get to the Otherwise we could also just special case on |
I am changing my original proposal, since this is a rare pattern and honestly new-able + callable sounds like trouble. I suggest ignoring the new-able semantics and just outputting it as We have only seen 2 places where this is used ( |
Yeah, this seems like a corner case, and as you can specify explicitly when something should be |
The following simple definitions transpile to classes that extend tempCtor.
and
outputs
The text was updated successfully, but these errors were encountered: