Skip to content

Unified: Fix two bugs in parameter name scoping - #22960

Draft
asgerf wants to merge 7 commits into
github:mainfrom
asgerf:unified/func-param-clash
Draft

asgerf wants to merge 7 commits into
github:mainfrom
asgerf:unified/func-param-clash

Conversation

@asgerf

@asgerf asgerf commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes two bugs:

  • When a parameter had the same name as its enclosing function, they mapped to the same (name, scope) pair, and thus got the same LocalName entity. This entity had multiple declaring callables resulting in consistency errors.
  • Parameter defaults can't refer to the parameter list (in Swift) and were incorrectly resolved in this case.

@asgerf asgerf added the no-change-note-required This PR does not need a change note label Oct 30, 2026
predicate implicitDeclInScope(string name, AstNode scope) { implicitDeclInScope(name, scope, _) }

predicate accessCand(AstNode n, string name) { n.(PotentialLocalNameAccess).getName() = name }
predicate accessCand(AstNode n, string name) {
@asgerf
asgerf force-pushed the unified/func-param-clash branch from 959ff4f to 67db149 Compare October 30, 2026 14:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants