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
In #370, we designed the Property interfaces to support covariant usages and I think that issue is at a good point. TypeScript 4.7 Beta introduced a new feature that overlaps with that somewhat:
It allows you to specify in and/or out annotations on type parameters. I thought I would bring it to our attention in case it informs #370 or other covariant/contravariant discussions. Tagging @pixelzoom and @jonathanolson so they are aware. Not really sure what would have to happen for this issue to be closed. Perhaps review/understand the new annotations and determine where they are appropriate to use in our codebase?
The text was updated successfully, but these errors were encountered:
Thanks, I read the reference. Variance annotations sounds like a feature to be used judiciously. It also isn't clear to me whether TS will prevent you from (for example) using the in annotation for something that is actually used as an output. (And I didn't have time or inclination to experiment.)
We applied a usage of this (incorrectly) in Joist as part of phetsims/joist#783 and had some discussion as a team. Any more effort here can be done on-demand in the future when necessary. Closing.
In #370, we designed the Property interfaces to support covariant usages and I think that issue is at a good point. TypeScript 4.7 Beta introduced a new feature that overlaps with that somewhat:
Optional Variance Annotations for Type Parameters
https://devblogs.microsoft.com/typescript/announcing-typescript-4-7-beta/#optional-variance-annotations-for-type-parameters
It allows you to specify
in
and/orout
annotations on type parameters. I thought I would bring it to our attention in case it informs #370 or other covariant/contravariant discussions. Tagging @pixelzoom and @jonathanolson so they are aware. Not really sure what would have to happen for this issue to be closed. Perhaps review/understand the new annotations and determine where they are appropriate to use in our codebase?The text was updated successfully, but these errors were encountered: