rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
153 stars 47 forks source link

Validate class member assignment type mismatch #879

Closed TwitchBronBron closed 10 months ago

TwitchBronBron commented 11 months ago

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 commented 11 months ago

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 commented 10 months ago

Fixed with https://github.com/rokucommunity/brighterscript/commit/a2c153aff1be92b4b50e909cda62b2c0179cf70c

markwpearce commented 10 months ago

closed