fix(solid_generator): doc-comment .value rewrite + effect materialization lint (dev.9) - #115
Merged
nank1ro merged 1 commit intoAug 29, 2026
Conversation
…tion lint Two quirks: - A doc-comment reference to a reactive field (/// [count]) is no longer rewritten to [count.value] — the value rewriter skips comment references. - @SolidEffect lowers to a declared 'late final Effect <name>;' assigned at its materialization site instead of a bare '<name>;' touch, so generated output no longer trips unnecessary_statements. Same closure, same timing. Adds doc_comment_reference_preserved + two_effects_ordering goldens. Reviewed by 2 adversarial reviewers (0 bugs; 1 doc nit fixed, multi-effect golden added, factory-redirect edge documented).
nank1ro
deleted the
fix/generator-doccomment-and-effect-materialization
branch
August 29, 2026 02:33
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.
Two generator quirks surfaced while building an app on dev.8.
Quirk A — doc-comment references get
.valueA documentation-comment reference to a reactive field (
/// … [count] …) was rewritten to[count.value]— an invalid reference that tripscomment_references._ValueRewriteVisitornow skipsCommentsubtrees (comment references resolve as declarations, not runtime reads), so the doc comment survives untouched while the member body still gets its.valueappend.Quirk B —
@SolidEffecttripsunnecessary_statements@SolidEffectlowered tolate final <name> = Effect(...)plus a bare<name>;"touch" statement (in the synthesized constructor /initState) to force the lazy initializer. That bare statement tripsunnecessary_statementsin the generated output. It now lowers to a declaredlate final Effect <name>;field plus an assignment<name> = Effect(...)at the materialization site — lint-clean, and the canonical flutter_solidart idiom. The field stayslate finalbecause the closure reads sibling instance fields (a non-late initializer can't). Behaviour is unchanged: same closure, same materialization timing, same reverse-dispose order.Tests
doc_comment_reference_preserved,two_effects_ordering(locks multi-effect declaration + assignment ordering).dart analyze libclean.Reviewed by 2 adversarial reviewers (0 bugs). Bumps
solid_generatorto 3.0.0-dev.9.