Skip to content

Conversation

@hborla
Copy link
Member

@hborla hborla commented Jun 15, 2023

  • Explanation: The eager generic argument matching code in CSGen for unresolved specializations was incorrect because it didn't account for parameter packs, which lead to ambiguity error messages when using a variadic generic type that shares a name with a macro. Fortunately, a constraint to delay explicit generic argument matching already exists for macros. Use it here. This also fixes a longstanding issue where references to generic typealiases were handled incorrectly in expressions, leading to bogus and misleading error messages.
  • Issue: rdar://110800793
  • Risk: Low. Most generic code does not go through the UnresolvedSpecializeExpr code path, and many of the cases that do didn't work properly anyway.
  • Testing: Added new tests for the macro/type ambiguity, and updated existing type alias tests that had incorrect behavior (removing some FIXMEs from 2017!)
  • Reviewer: @DougGregor
  • Main branch PR: [ConstraintSystem] Use an explicit generic argument constraint for UnresolvedSpecializeExpr. #66657

hborla added 2 commits June 15, 2023 09:36
UnresolvedSpecializeExpr.

The eager generic argument matching code in CSGen for unresolved
specializations was incorrect because it didn't account for parameter
packs. Fortunately, a constraint to delay explicit generic argument
matching already exists for macros. Use it here.

(cherry picked from commit eb858d9)
constraint simplification.

(cherry picked from commit d357315)
@hborla hborla requested a review from a team as a code owner June 15, 2023 16:46
@hborla
Copy link
Member Author

hborla commented Jun 15, 2023

@swift-ci please test

@hborla hborla merged commit 6b60452 into swiftlang:release/5.9 Jun 15, 2023
@hborla hborla deleted the 5.9-variadic-macro-specialization branch June 15, 2023 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants