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
type generics constraints incompatible assignable typings extends class subclass this
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about any of these keywords "type generics constraints incompatible assignable typings extends class subclass this".
As you can see, Device_d_ts does not extend Entity_d_ts (fromtyping is 'ko'), whereas Device extends Entity (fromsources is 'ok').
Thus, through typings the type check yields a different result from the original type definitions.
🙂 Expected behavior
I would have expected the same behavior regardless of using typings or not.
Which one is correct?
Both fromtyping and fromsources must be 'ko'
Both fromtyping and fromsources must be 'ok'
The text was updated successfully, but these errors were encountered:
My initial guess is some kind of discrepancy in variance measurement but yeah, this is weird since Device_d_ts is explicitly a subclass of Entity_d_ts and there’s no error on the class definition that would suggest the subclassing is invalid
This example encounters a limitation in our variance measurement algorithm. Annotated example:
exportclassSubject<inTSubscriber,outTMethodextendsTSubscriber[keyofTSubscriber]>{constructor(protectedreadonlyselector: (subscriber: TSubscriber)=>TMethod){}}exportclassBehaviors<outTEntityextendsEntity>// Under v1, this is incorrectly measured as covariant on TEntity// Under v2, it is correctly measured as invariant{// v1protectedreadonly_onAdded$=newSubject((it: OnBehaviorAdded<TEntity>)=>it.onBehaviorAdded);// v2// protected readonly _onAdded$: Subject<OnBehaviorAdded<TEntity>, (entity: TEntity) => void> = null as any;constructor(protectedreadonlyentity: TEntity){}}exportinterfaceOnBehaviorAdded<inTEntityextendsEntity>{onBehaviorAdded(entity: TEntity): void;}exportabstractclassEntity{readonlybehaviors=newBehaviors(this);}exportclassDeviceextendsEntity{readonlyid=0;}
See #44572 for more details (including links to longer discussion)
Bug Report
🔎 Search Terms
type generics constraints incompatible assignable typings extends class subclass this
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about any of these keywords "type generics constraints incompatible assignable typings extends class subclass this".
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
As you can see,
Device_d_ts
does not extendEntity_d_ts
(fromtyping
is'ko'
), whereasDevice
extendsEntity
(fromsources
is'ok'
).Thus, through typings the type check yields a different result from the original type definitions.
🙂 Expected behavior
I would have expected the same behavior regardless of using typings or not.
Which one is correct?
fromtyping
andfromsources
must be'ko'
fromtyping
andfromsources
must be'ok'
The text was updated successfully, but these errors were encountered: