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
Noted when reviewing #59 , and for code review #41 ...
In IntroModel.ts:
publicreadonly isShowingPredictMeanProperty: BooleanProperty;publicreadonly isShowingMeanProperty: BooleanProperty;publicreadonly isShowingTickMarksProperty: BooleanProperty;// Property that tracks whether auto-share is enabled or not.publicreadonly isAutoSharingProperty: BooleanProperty;
All of the above declarations should be Property<boolean>. There's nothing about the BooleanProperty subclass of Property<boolean> that needs to be exposed via the API. Instantiation using new BooleanProperty is correct.
This is not isolated to IntroModel.ts. I see this issue across many .ts files. Sorry I missed it during code review.
In general... The type used in the declaration of a field is not always the same type used when instantiating that field. Declarations should use the most general (narrowest API) type, and instantiation may be a more specific subtype. The same is true for method and function parameters.
Happy to discuss if this needs clarification.
The text was updated successfully, but these errors were encountered:
@zepumph helped me make sense of some of the type errors that came up when I tried this. I believe everything that could be converted has been converted, so sending over to @pixelzoom for a final look-over before closing.
Noted when reviewing #59 , and for code review #41 ...
In IntroModel.ts:
All of the above declarations should be
Property<boolean>
. There's nothing about theBooleanProperty
subclass ofProperty<boolean>
that needs to be exposed via the API. Instantiation usingnew BooleanProperty
is correct.This is not isolated to IntroModel.ts. I see this issue across many .ts files. Sorry I missed it during code review.
In general... The type used in the declaration of a field is not always the same type used when instantiating that field. Declarations should use the most general (narrowest API) type, and instantiation may be a more specific subtype. The same is true for method and function parameters.
Happy to discuss if this needs clarification.
The text was updated successfully, but these errors were encountered: