fix: raise BackendVarFormatError for the remaining backend var UI uses
SH
4h ago+219+219+012345678901234567890123456789-23-23-01234567890123456789
All Submissions:
- Have you followed the guidelines stated in CONTRIBUTING.md file?
- Have you checked to ensure there aren't any other open Pull Requests for the desired changed?
Type of change
- Bug fix (non-breaking change which fixes an issue)
Changes To Core Features:
- Have you added an explanation of what your changes do and why you'd like us to include them?
- Have you written new tests for your core changes, as applicable?
- Have you successfully ran tests with your changes locally?
Description
Closes #7843.
Every row in the issue now raises the same BackendVarFormatError as the other UI paths, and none of them prints the default value:
- children and typed props check for a
Fieldbefore the generic checks. Themetarow goes through the typed prop check, so it raises when the page compiles. - event arguments re-raise the error that
LiteralVar.createalready builds, instead of wrapping it inEventHandlerTypeError. add_pagecheckson_load, the same way it checkstitle,descriptionandimage.Field.__eq__raises when a backend var is compared with something that isn't a field, and__bool__raises for a backend var. Field-to-field comparison stays identity, and__hash__staysobject.__hash__, so dict keys, sets andinchecks over fields work as before.
The comparison and bool checks also cover a mixin's fields, since formatting one already raises the mixin message. I kept the check off ordering (State._n > 0) and in, which already fail with a plain TypeError rather than silently.
Tests: one per row, plus mixins, field identity and hashing. The 13 new or changed tests fail on main and pass with the fix. The full unit suite has the same failures as main (only the pyi_generator tests, which fail on my machine with or without this change). I also updated the two upgrading guides that described the old errors.