mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
`SourceEntityWalker` had an unbalanced `walkToDeclPre` and `walkToDeclPost`, ie. `walkToDeclPost` could be called even though `walkToDeclPre` was not. Specifically, this would occur for both `OperatorDecl` and `PrecedenceGroupDecl` declarations. These could both be added to the `if` in `walkToDeclPost`, but this seems fairly errorprone in general - especially as new decls are added. Indeed, there's already declarations that are being skipped because they aren't explicitly tested for in `walkToDeclPre`, ie. `PatternBindingDecl`. Instead of skipping if not explcitly handled, only skip running the `SEWalker` walk methods if the declaration is implicit (and not a constructor decl, see TODO). This should probably also always visit children, with various decls changed to become implicit (eg. TopLevelCodeDecl), but we can do that later - breaks too many tests for now. This change exposed a few parameter declarations that were missing their implicit flag, as well as unbalanced walk methods in `RangeResolver`.
14 KiB
14 KiB