Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ConstraintSystem] Allow type variables for pack expansion patterns to bind to noescape. #64390

Merged
merged 1 commit into from Mar 15, 2023

Conversation

hborla
Copy link
Member

@hborla hborla commented Mar 15, 2023

Otherwise, the constraint system will produce diagnostics when forwarding noescape function value packs, e.g.

func takesFunctionPack<each T, R>(functions: repeat ((each T) -> R)) {}

func forwardFunctionPack<each T>(functions: repeat (each T) -> Bool) {
  takesFunctionPack(functions: repeat each functions)
}

@hborla hborla requested a review from xedin as a code owner March 15, 2023 16:40
@hborla
Copy link
Member Author

hborla commented Mar 15, 2023

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Mar 15, 2023

@swift-ci please test Windows

@@ -5394,6 +5394,7 @@ class OpenPackElementType {

auto *elementType = cs.createTypeVariable(locator,
TVO_CanBindToHole |
TVO_CanBindToNoEscape |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more for "extra" no-escape? :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Clearly I should drink my coffee before attempting to write any code 🙂

@hborla hborla changed the title [ConstraintSystem] Allow type variables for pack expansion patterns and opened pack elements to bind to noescape. [ConstraintSystem] Allow type variables for pack expansion patterns to bind to noescape. Mar 15, 2023
@hborla
Copy link
Member Author

hborla commented Mar 15, 2023

@swift-ci please smoke test

@hborla hborla merged commit aeab985 into apple:main Mar 15, 2023
3 checks passed
@hborla hborla deleted the noescape-value-packs branch March 15, 2023 22:45
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.

None yet

2 participants