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

[ModuleInterfaces] Escape `Type` and `Protocol` when module-qualifying #27065

Merged
merged 1 commit into from Sep 11, 2019

Conversation

@harlanhaskins
Copy link
Collaborator

commented Sep 6, 2019

If we see MyModule.Type, the parser thinks this is a metatype type.
Escape the name Type and Protocol so the parser can recognize they're type names.

Fixes SR-11422
Fixes rdar://55094784

@harlanhaskins harlanhaskins requested a review from jrose-apple Sep 6, 2019

@jrose-apple jrose-apple requested a review from brentdax Sep 6, 2019

@harlanhaskins

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 6, 2019

@swift-ci please smoke test

@brentdax
Copy link
Collaborator

left a comment

I have one small documentation change you definitely need to make; the rest I could be wrong about.

include/swift/AST/ASTPrinter.h Show resolved Hide resolved
lib/AST/ASTPrinter.cpp Outdated Show resolved Hide resolved
lib/AST/ASTPrinter.cpp Outdated Show resolved Hide resolved

@harlanhaskins harlanhaskins force-pushed the harlanhaskins:type-and-circumstance branch 2 times, most recently from c59a128 to 8109832 Sep 10, 2019

[ModuleInterfaces] Escape `Type` and `Protocol` when module-qualifying
If we see `MyModule.Type`, the parser thinks this is a metatype type.
Escape the name `Type` so the parser can recognize it's a type name.

Fixes [SR-11422](https://bugs.swift.org/browse/SR-11422) rdar://55094784

@harlanhaskins harlanhaskins force-pushed the harlanhaskins:type-and-circumstance branch from 8109832 to 2893d96 Sep 10, 2019

@harlanhaskins

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 10, 2019

@brentdax How's it look now?

@harlanhaskins

This comment has been minimized.

Copy link
Collaborator Author

commented Sep 10, 2019

@swift-ci please test

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

Build failed
Swift Test OS X Platform
Git Sha - e7d8d24

@swift-ci

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2019

Build failed
Swift Test Linux Platform
Git Sha - e7d8d24

@harlanhaskins harlanhaskins merged commit 37382fe into apple:master Sep 11, 2019

4 checks passed

Swift Test Linux Platform No test results found.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform No test results found.
Details
Swift Test OS X Platform (smoke test)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.