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:
Jim Ingham
2014-03-27 20:34:45 +00:00
parent 9dd5fa3fcf
commit 7f11e5b620
2 changed files with 13 additions and 3 deletions

View File

@@ -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()) {