ast: drop verifyGenerated, and give a macro-added field its location - #3694
Merged
Conversation
add_structure_field set name, type and init but never at, so every field a macro adds had none. Through the _interface_<Name> field that daslib/interfaces adds, that emptied the per-field ExprDelete of the generated finalizer, which is the at generatePointerFinalizer stamps its whole body with - one missing location became 575 location-less nodes across tutorials/language/43_interfaces.das and tutorials/macros/08_variant_macro.das. The field reports at the type it was built from, or at the structure it is added to, so no caller has to change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
aleksisch
force-pushed
the
aleksisch/drop-verify-generated
branch
from
August 11, 2026 13:51
9473ca9 to
d6a81cf
Compare
It verified nothing: both of its guards, VERIFY_GENERATED and LOG_GENERATED, are 0, so all 22 call sites were no-ops - and the check it once held moved to daslib/ast_verify, which reports over every module instead of asserting in a build nobody enables. Gone entirely: both overloads, the declarations, every call site, and the LOG_GENERATED define that only the deleted trace used. The location invariant it was meant to guard now holds because the generators set locations themselves - see the add_structure_field fix in the previous commit for what the stamping overload had been hiding. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
aleksisch
force-pushed
the
aleksisch/drop-verify-generated
branch
from
August 11, 2026 13:55
d6a81cf to
57ee1e2
Compare
aleksisch
changed the base branch from
aleksisch/remove_ast_validate
to
master
August 11, 2026 13:56
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.
Stacked on #3686 — base is
aleksisch/remove_ast_validate, so this diff is just the two commits below.verifyGeneratedis goneIt verified nothing. Both of its guards were off:
so all 22 call sites were no-ops, and the only real check it ever held —
CheckLineInfoVisitor, asserting that generated nodes carry a location — was already removed in #3686 becausedaslib/ast_verifydoes that job over every module, reporting instead of asserting in a configuration nobody enables.Removed entirely: both overloads, the declarations in
ast_generate.h, every call site, and theLOG_GENERATEDdefine that only the deleted trace used.What the removal exposed
#3686 had an overload that stamped a generated function body with the function's location. Deleting it regressed 423 reports in
tutorials/language/43_interfaces.dasand 152 intutorials/macros/08_variant_macro.das— and all 575 came from one missingat:add_structure_field(daslib/templates_boost.das) setname,_typeandinitbut neverat, so every field a macro adds was location-less.daslib/interfacesadds_interface_<Name>that way;generateStructureFinalizerthen builds a per-fieldExprDeleteatfl.at(empty), infer passes that as theatforgeneratePointerFinalizer, and that generator stamps every node of the finalizer body with it.The field now reports at the type it was built from, falling back to the structure it is added to — no signature change, so the other four callers and any external macro code benefit too.
So the stamping overload was masking a one-line bug in a published daslib helper, behind a function whose name said "verify" while it mutated. Deleting it was the right call.
Verification
--ast-verifyclean on the files that regressed and on the macro-heavy set:43_interfaces,08_variant_macro,29_functional,reflection,test_functional,optional_require,operators,decs,templates_boost,interfacestests/interpreter suite: 13307 passed, 0 failed, 0 errors, 7 skipped — identical to before the change.dasLocalizing the root took two throwaway
fprintfprobes (which of the four finalizer generators received an emptyat, then which field produced it); both are removed.🤖 Generated with Claude Code