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
This would have identical semantics to the following (currently legal) syntax: ...
A small usability improvement to allow interfaces to more easily declare that primitives cannot be assigned to them.
To be clear, this doesn't work today, which is why it's disallowed
type_obj=object;interfaceLengthyObjextends_obj{length: number;}functionfooObj(s: LengthyObj){}// No error...fooObj("hello");
@RyanCavanaugh yep, figured that out shortly after I wrote it (although interestingly it does work for the specific example I posted, which is the case of the empty interface).
π Search Terms
interface extends object
β Viability Checklist
β Suggestion
I propose to allow the following syntax:
This would have identical semantics to the following (currently legal) syntax:
Details:
I'm requesting this feature mainly because it was the only pain-point mentioned in this related issue. To quote:
Regardless of the outcome of that other issue however, it would be nice to be able to
extends object
without going through that kind of hassle.π Motivating Example
A small usability improvement to allow interfaces to more easily declare that primitives cannot be assigned to them.
π» Use Cases
The text was updated successfully, but these errors were encountered: