Skip to content

[lldb] SwiftLanguageRuntime::MethodName::Parse should reject objc methods #3294

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

Conversation

bulbazord
Copy link

According to the Swift Reference Manual, swift identifiers are not
allowed to start with '+', '-', or '['. Reject any names starting with
those characters.

cc @adrian-prantl @kastiglione

@bulbazord
Copy link
Author

@swift-ci please test

@bulbazord
Copy link
Author

@adrian-prantl I don't have commit access to apple/llvm-project, could you commit this for me? Thanks!

@kastiglione
Copy link

swiftc also rejects function names with +, -, and [. Should we check the whole string not just the first char?

I tried

func `a+b`() { ... }
func `a-b`() { ... }
func `a[b]`() { ... }

@bulbazord
Copy link
Author

swiftc also rejects function names with +, -, and [. Should we check the whole string not just the first char?

I tried

func `a+b`() { ... }
func `a-b`() { ... }
func `a[b]`() { ... }

Sure, I can add those too. I would like to also (in a different PR/change) add some tests to SwiftLanguageRuntime::MethodName in the same way we test CPlusPlusLanguage::MethodName. Sound good to you?

…bjc methods

According to the Swift Reference Manual, swift identifiers are not
allowed to start with '+', '-', or '['. Reject any names starting with
those characters.
@bulbazord bulbazord force-pushed the reject-objc-embrace-swift branch from 484c425 to 1febca3 Compare September 30, 2021 00:09
@bulbazord
Copy link
Author

Updated to reject names with +, -, and [ in general. :)

@bulbazord
Copy link
Author

@swift-ci please test

@kastiglione
Copy link

The follow up would have worked for me also. Thanks.

@JDevlieghere JDevlieghere merged commit b068ac5 into swiftlang:stable/20210726 Sep 30, 2021
@bulbazord bulbazord deleted the reject-objc-embrace-swift branch September 30, 2021 17:10
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.

4 participants