Skip to content

Hardcode that the Swift.AnyObject typealias resolves to the builtin A… #4882

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

adrian-prantl
Copy link

Hardcode that the Swift.AnyObject typealias resolves to the builtin A…
…nyObject type.

This prevents round-tripping to SwiftASTContext to resolve these types.

@adrian-prantl
Copy link
Author

@swift-ci test

if (!module || !module->hasText() || module->getText() != swift::STDLIB_NAME)
return false;
NodePointer ident = node->getChild(1);
if (!ident || !ident->hasText() || ident->getText() != "AnyObject")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, you could replace these two lines with:

return ident && ident->hasText() && ident->getText() == "AnyObject";

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't want to make it harder to read by suddenly inverting the conditions on the last line.

@adrian-prantl
Copy link
Author

@swift-ci test macOS

…nyObject type.

This prevents round-tripping to SwiftASTContext to resolve these types.
@adrian-prantl
Copy link
Author

@swift-ci test

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