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

Xcode shows an error message when importing a module that declares a typealias to a protocol with a primary associated type #60550

Closed
tgrapperon opened this issue Aug 14, 2022 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@tgrapperon
Copy link

tgrapperon commented Aug 14, 2022

Describe the bug
Xcode 14beta5 shows a message stating that "An internal error occurred. Source editor functionality is limited. Attempting to restore..." when importing a module that declare a typealias to a protocol with a primary associated type (and where the alias specifies the primary associated type, generically or not).

Steps To Reproduce
Steps to reproduce the behavior:

  1. In the module A of a package, declare
public protocol Foo<Bar> {
  associatedtype Bar
}
public typealias Problem = Foo<String>
  1. In a module B, import A, and then start to type struct Hello {}
  2. It builds after completing the declaration, but it shows an error message at the top of the editor.

Expected behavior
Nothing happens.

Screenshots
ErrorMessage

Environment (please fill out the following information)

  • macOS 13.0 beta 5 (22A5321d)
  • Xcode 4.0 beta 5 (14A5294e)

Additional context
Here is a package where the issue can be reproduced by starting editing the EditThis.swift file: XcodeIssue.zip.
This is likely related to pointfreeco/swift-composable-architecture#1264
Associated Feedback: FB11244375
The issue started to occur in Xcode 14.0 beta 4. There is no issue when using Xcode 14.0 beta 3.

@tgrapperon tgrapperon added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Aug 14, 2022
@tgrapperon tgrapperon changed the title Xcode shows an error message when importing a module that declare a typealias to a protocol with a primary associated type Xcode shows an error message when importing a module that declares a typealias to a protocol with a primary associated type Aug 15, 2022
@ahoppen
Copy link
Member

ahoppen commented Oct 4, 2022

Sorry for getting to this bug report so late.

The problem should be fixed by #60801, which is included in the Xcode 14.1 betas. Could you check if you are still seeing the issue with these betas? If this continues to be an issue, feel free to re-open the issue and I’ll take another look.

@ahoppen ahoppen closed this as completed Oct 4, 2022
@tgrapperon
Copy link
Author

It indeed appeared to be fixed in 14.1b3, but I wasn't sure it was not coincidental so I planned to wait for the RC to confirm and eventually close it. Thanks for the update!

@ahoppen
Copy link
Member

ahoppen commented Oct 4, 2022

Thanks for checking.

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.
Projects
None yet
Development

No branches or pull requests

2 participants