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

Nested constrained opaque result type example from SE-0346 doesn't compile #61409

Open
dnadoba opened this issue Oct 3, 2022 · 2 comments
Open
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself generics Feature: generic declarations and types type checker Area → compiler: Semantic analysis

Comments

@dnadoba
Copy link
Contributor

dnadoba commented Oct 3, 2022

Describe the bug
The nested constrained opaque result type example from SE-0346 produces an error:

func transform(
    _ foo: some Sequence<some Equatable>
) -> some Sequence<some Equatable> { // error: 'some' types are only permitted in properties, subscripts, and functions
    [1] 
}

Note: slightly modified, added argument name and function body to make it valid Swift code

Steps To Reproduce
compile the above code

Expected behavior
no error

Environment (please fill out the following information)

  • OS: 13.0 Beta (22A5358e)
  • Xcode Version/Tag/Branch: Version 14.1 beta 3 (14B5033e)
    Also tested with Trunk Development Snapshot from September 29, 2022 and Xcode Version 14.0.1 (14A400)
@dnadoba dnadoba added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Oct 3, 2022
@theblixguy theblixguy added type checker Area → compiler: Semantic analysis generics Feature: generic declarations and types labels Oct 3, 2022
@slavapestov slavapestov self-assigned this Oct 3, 2022
@slavapestov
Copy link
Contributor

Yeah, this is a known limitation, sorry.

@slavapestov
Copy link
Contributor

Radar: rdar://89790826

@AnthonyLatsis AnthonyLatsis added the compiler The Swift compiler itself label Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler itself generics Feature: generic declarations and types type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

4 participants