Skip to content

Update the error message when subscripting String with Int. #27069

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

Merged
merged 3 commits into from
Sep 10, 2019

Conversation

natecook1000
Copy link
Member

@natecook1000 natecook1000 commented Sep 6, 2019

Instead of referring to a doc comment that isn't really accessible to the developer, let's just be accurate about what type they should be using here.

rdar://problem/33715475

Instead of referring to a doc comment that isn't really accessible to the
developer, let's be accurate about what type they should be using here.
@amartini51
Copy link
Member

I think this is an improvement — it gives concrete, actionable feedback of what to you should do when you see this error.

The doc comments have more detailed information about why these methods shouldn't exist. However, I'm not finding a way to view that content in Xcode or on developer.apple.com. Is that expected?

@natecook1000
Copy link
Member Author

IIRC the doc comments that have this info are on extensions, which don’t end up being attached to any particular symbol when SourceKit imports the module. Would this info make sense to move to the actual subscript docs? It feels a little weird to explain why an API isn’t written a different way, and there is an SE proposal to add Int-offset-based element access and slicing…

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test and merge

@amartini51
Copy link
Member

Looks like the smoke test failed because test/stdlib/UnavailableStringAPIs.swift.gyb is expecting the old error messages.

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

@natecook1000 natecook1000 merged commit ce28cde into swiftlang:master Sep 10, 2019
@natecook1000 natecook1000 deleted the nate/string_int_message branch September 10, 2019 17:23
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