Repository navigation
v0.18.0
Important
declscope shrink reports change on unchanged code. Some values of an enum are no longer reported, and an existing //declscope:ignore overexported on such a value can now be reported as unused. The analyzer is unchanged.
shrink
-
The values of an enum are judged as one set. A
constblock of 2 or more constants, all of one exported type of the package, is a set. Before, each constant was judged on its own, so a set could split: the values another package happened to use stayed exported, and the rest were unexported. Keeping it whole took one ignore per value. (#179, #180)// internal/user/user.go type Status string const ( Active Status = "active" Blocked Status = "blocked" ) const DefaultStatus Status = Active // api/api.go var _ = user.Active
Case Result The type is used, silenced or baselined, or another package uses any value No value of the set is reported. BlockedaboveThe type is reported Every value is reported with it One value keeps its name Every other value's fix is withheld: another value of its const block keeps its nameA constant outside such a block Judged on its own, as before. DefaultStatusaboveA block that mixes in another constant, or a block of another package's type such as time.DurationNot a set, judged one by one To put a default in the set, put it in the block. Implicit types from
iotaor a repeated expression count. A blank_does not.An ignore you added to keep a set whole is now reported as unused when the set is left alone. Remove it.
Specs
shrink_settle.fslproves that a const set is fixed or kept whole, and that one run of-fixstill settles the package. (#181)- Every
leadsTois proved for all depths, by a ranking measure, andverify.shchecks that each one is. The specs move to fslc 4.8.1. (#178)