feat: deprecated parameter #399
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/46-deprecated-parameter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #46
Task
A parameter can carry the
deprecated(...)clause; a call that passes it warns, and the lint rule renames the label.What and why
deprecated("reason", replacement: "timeout", since: "0.4")stands on its own line in front of a parameter (parser enforces the own line, the formatter keeps the parameter below it).replacement:names another parameter of the same function with the same type; passing both is an error; variadic,var,lazy, receiver-closure parameters and parameters of local functions cannot be deprecated.connect(wait:)is deprecated since 0.4: ...) with a note naming the replacement; same exemptions as DEPRECATION.md section 3;--deny deprecatedcovers it.torb lint --fix --rule deprecatedrewrites the labelwait:totimeout:; positional uses and calls passing both keep the finding.torb docentry and the language server tag for parameters, tuple and case-field labels.skills/.Test
compiler/tests/deprecation.test.trb(parser, checker errors, warnings,--deny, lint fix) andcompiler/tests/format.test.trbpass locally on the nightly (45 and 76 tests);torb check compilerclean,format --checkon touched files,docs check --no-snippetsanddocs skill --checkclean.seed touch: no
Approved. Checklist for head
624f143:deprecation.test.trbcovers the parser (own-line rule), the checker errors (default, replacement, type, variadic/lazy/var, local functions), both-passed, warning by label and position,--deny, and the lint fix with the no-fix cases.format.test.trbcovers layout. CI is green on this head (gates, bootstrap, tier A, pdisc).targets) and drops the receiver; same-file uses are exempt as in DEPRECATION.md section 3; the fix is label-only and skipped for positional or both-passed calls.lint --fixmoves the label); the doc entry and language-server tag are explicitly deferred and recorded in the design record.skills/copies are updated; pdisc is green.Non-blocking:
deprecatedUsesOfno longer returns early whendeprecationsis empty, so every module is now walked for argument uses. If check time on large workspaces shows up, an early exit on "no function in the program has a deprecated parameter" would restore it.