Repository navigation
Unified: Allow pattern-less parameters. - #22791
Conversation
0d23722 to
5b98c6c
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The fallback makes parameter type syntax participate in control flow through generic child traversal.
1 open finding
What changed in this PR
Allows patternless Swift enum-case parameters to participate in the CFG, resolving dead-end consistency failures.
Changes:
- Falls back to the parameter itself when no pattern exists.
- Updates generated consistency expectations.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| AstNode getPattern() { | ||
| result = super.getPattern() | ||
| or | ||
| not exists(super.getPattern()) and result = this | ||
| } |
asgerf
left a comment
There was a problem hiding this comment.
LGTM. The comment from CCR might be worth looking at, but feel free to merge otherwise
There was a problem hiding this comment.
It looks like these empty files were not deleted?
There was a problem hiding this comment.
(Here is what I normally run: find unified/ql/test -name "*Consistency.expected" -size 0 -print -delete)
There was a problem hiding this comment.
Huh, I mostly just used --learn, so I guess that's not sufficient.
Yeah, I think that comment is actually accurate and something I'll want to address. |


Parameters of Swift enum case constructors currently don't have a pattern extracted, so the CFG breaks. In these cases the CFG library expects the parameter itself to act as pattern. This fixes a bunch of consistency errors.