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

[SR-13115] Invalid nested generic inheritance type name. #55561

Open
swift-ci opened this issue Jun 29, 2020 · 4 comments
Open

[SR-13115] Invalid nested generic inheritance type name. #55561

swift-ci opened this issue Jun 29, 2020 · 4 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-13115
Radar rdar://problem/66498000
Original Reporter MatyasKriz (JIRA User)
Type Bug
Environment

macOS 10.15.4

Xcode 10.2.1 as well as Xcode 11.5

Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: 822f9405b013863a0c634800f0f61bb8

Issue Description:

Examples:

struct gg<G: T<Int>> {} // "key.inheritedtypes > key.name" is "T<Int>>"

func bg<T: G<Void>>() // "key.inheritedtypes > key.name" is "G<Void>>"

This doesn't occur unless the inherited type is generic as well. It also only applies to the last inherited type, so for

<T, U: G<T>, V: G<U>>

only the inherited type `G<U>` is returned by SourceKit as `G<U>>`.

Also, this bug can be sidestepped by adding a space before the last `>`. So adding a space to the previous example

<T, U: G<T>, V: G<U> >

correctly returns just `G<U>` as the inherited type.

I suspect an off-by-one bug when fetching the inheritance type from the source code.

@swift-ci
Copy link
Collaborator Author

Comment by Matty Cross (JIRA)

This bug is also discussed here, where a structure of an example can be seen with incorrect type name as well as the offset and length.

@benlangmuir
Copy link
Member

@swift-ci create

@akyrtzi
Copy link
Member

akyrtzi commented Aug 14, 2020

Friendly reminder that for syntactic processing of files, SwiftSyntax is a much better tool to use than sourcekitd's structure response.�

@swift-ci
Copy link
Collaborator Author

Comment by Matty Cross (JIRA)

@akyrtzi Thanks for the suggestion. I actually didn't know there were other Swift parsing tools, I'll check it out.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 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.
Projects
None yet
Development

No branches or pull requests

3 participants