mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Get the parse phase to allow imports in contexts other than toplevel code
when DebuggerSupport is turned on. Swift SVN r15563
This commit is contained in:
@@ -1041,12 +1041,12 @@ ParserResult<ImportDecl> Parser::parseDeclImport(ParseDeclOptions Flags,
|
||||
Attributes.clearAttribute(AK_exported);
|
||||
if (Attributes.hasNonVirtualAttributes())
|
||||
diagnose(Attributes.AtLoc, diag::import_attributes);
|
||||
|
||||
if (!(Flags & PD_AllowTopLevel)) {
|
||||
|
||||
if (!Context.LangOpts.DebuggerSupport && !(Flags & PD_AllowTopLevel)) {
|
||||
diagnose(ImportLoc, diag::decl_inner_scope);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
ImportKind Kind = ImportKind::Module;
|
||||
SourceLoc KindLoc;
|
||||
if (Tok.isKeyword()) {
|
||||
|
||||
Reference in New Issue
Block a user