-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of as unknown as Node
in traits
#1498
Comments
jessegreenberg
added a commit
to phetsims/sun
that referenced
this issue
Nov 11, 2022
jessegreenberg
added a commit
that referenced
this issue
Nov 11, 2022
jessegreenberg
added a commit
that referenced
this issue
Nov 11, 2022
jessegreenberg
added a commit
to phetsims/phet-core
that referenced
this issue
Nov 11, 2022
jessegreenberg
added a commit
that referenced
this issue
Nov 11, 2022
@jonathanolson are you OK with this? I wanted to run it by you because it touched Paintable, Sizable, WidthSizable, HeightSizable, DelayedMutate. |
as uknown as Node
in traitsas unknown as Node
in traits
This looks great! It didn't used to work in previous TypeScript versions, I'm very glad it works now! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In phetsims/joist#881 @samreid showed a way to get rid of the
as unknown as Node
for traits.The way to make the type cast unecessary is to declare Node as the type for the constructor with
We should use that for other traits too!
I see
this as unknown as Node
inParallelDOM- this isn't a trait anymore, but the type casts are still necessary because of old implementation that used to assume trait. Would be nice to get rid of someday, but its larger than this issue.The text was updated successfully, but these errors were encountered: