mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Accept (and prefer) "import type" as a scoped import for any non-protocol type.
Previously this was spelled "import typealias", and that spelling will continue to be allowed (since someone may specifically be importing a typealias and want that to match), but now that 'type' is a keyword, "import type" is the right way to spell the generic "import any type" scoped import. Swift SVN r14488
This commit is contained in:
@@ -819,7 +819,7 @@ void Parser::parseDeclDelayed() {
|
||||
/// decl-import:
|
||||
/// 'import' attribute-list import-kind? import-path
|
||||
/// import-kind:
|
||||
/// 'typealias'
|
||||
/// ('type'|'typealias')
|
||||
/// 'struct'
|
||||
/// 'class'
|
||||
/// 'enum'
|
||||
@@ -847,6 +847,7 @@ ParserResult<ImportDecl> Parser::parseDeclImport(ParseDeclOptions Flags,
|
||||
SourceLoc KindLoc;
|
||||
if (Tok.isKeyword()) {
|
||||
switch (Tok.getKind()) {
|
||||
case tok::kw_type:
|
||||
case tok::kw_typealias:
|
||||
Kind = ImportKind::Type;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user