When I change the value of key code1 from true to 123, Studio’s typechecker warns me that this is invalid. So far so good, this is expected, since I explicitly said that dict has a type {[string]: boolean}, and putting a number there would be a silly mistake that it should catch.
Problem:
However, I don’t get a warning if I make this same mistake for the next line, and change code2’s value from false to 123. For some reason, the Studio type checker is ok with this and does NOT put a warning, even though I do want it to tell me that I’m making a mistake.
It seems like it only validates the type for the first key value pair in the dictionary, but not for subsequent pairs.
How should I properly ensure that ALL values stored in this dict are booleans? Did I just made a syntactical mistake? Or am I trying to do something that I shouldn’t even be trying to do?
Works fine for me as-is. Maybe restart Studio?
Maybe just try retyping ‘boolean’ and see if that causes it to rethink what it’s doing. You running the Beta type solver?
I changed the value of first pair to 123 and was warned and changed back to true. I may have used 111 when I changed the second, but otherwise it warned me. After that I did a number of change combinations like leaving both as numbers, setting both to true at first and such and was warned every time. [yes. copied/pasted your code]
Edit: rechecked, and yes, 123 on second key-value pair warns me. I’m not using the Beta version of the lua checker.
Ah, thanks, you’re a lifesaver, I was so lost. Yes, I’m using the Beta checker. Let me try turning off the beta checker and seeing if it warns me successfully.
Edit: confirmed, it fails to warn me when using the Beta type solver , but it does warn me once I turn off this Beta feature.