Skip to content
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

Validate class member assignment type mismatch #879

Closed
TwitchBronBron opened this issue Sep 2, 2023 · 3 comments
Closed

Validate class member assignment type mismatch #879

TwitchBronBron opened this issue Sep 2, 2023 · 3 comments
Milestone

Comments

@TwitchBronBron
Copy link
Member

With the new type validations in v0.66.0 alphas, we should be able to assign a specific type to classes, and therefore validate type mismatches for class members. Line 3 should be an error because we're assigning an integer to a string.

image

@markwpearce
Copy link
Collaborator

If lhs of assignment is a dotted get expression, then we can use isTypeCompatible of left vs. The rhs type. This should also catch when we do assignments for components to make sure the type is correct

@markwpearce
Copy link
Collaborator

Fixed with a2c153a

@markwpearce
Copy link
Collaborator

closed

@TwitchBronBron TwitchBronBron added this to the v1.0.0 milestone Jan 24, 2024
@TwitchBronBron TwitchBronBron removed the v1 label Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants