Repository navigation
fix: translate a class with a field named _type - #63
Merged
Merged
Conversation
ylluminate
force-pushed
the
fix-field-named-type
branch
from
November 13, 2026 15:01
35d1cbe to
8029e53
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A class with a field named
_typemade py2v fail on the whole file:The frontend wrote a class's field types and its field defaults as JSON objects keyed by the field name, and V's
json2reads a_typekey in an object as a sum type tag when it decodes intojson2.Any. Both are now written as lists of[name, value]pairs and read back that way, so a field name is never read as a key.I ran into it on textual, in
css/_style_properties.py.Test plan
tests/cases/class_field_named_type.pywith its expected V. Master fails on it with the error above; with this change the emitted V builds and printsword, as Python does.v tests/run_tests.vsh: 179 passed, 0 failed (178 before, plus the new case), so every existing class case reads its fields and defaults the same through the new form.