Skip to content

Commit 5e019e7

Browse files
authored
Merge pull request #5760 from CodaFi/precedencecolinensinainciusol
2 parents 528ef15 + 75d28e1 commit 5e019e7

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5612,6 +5612,13 @@ ParserResult<PrecedenceGroupDecl>
56125612
Parser::parseDeclPrecedenceGroup(ParseDeclOptions flags,
56135613
DeclAttributes &attributes) {
56145614
SourceLoc precedenceGroupLoc = consumeToken(tok::kw_precedencegroup);
5615+
DebuggerContextChange DCC (*this);
5616+
5617+
if (!CodeCompletion && !DCC.movedToTopLevel() && !(flags & PD_AllowTopLevel))
5618+
{
5619+
diagnose(precedenceGroupLoc, diag::decl_inner_scope);
5620+
return nullptr;
5621+
}
56155622

56165623
Identifier name;
56175624
SourceLoc nameLoc;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
// See http://swift.org/LICENSE.txt for license information
66
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not --crash %target-swift-frontend %s -emit-ir
8+
// RUN: not %target-swift-frontend %s -emit-ir
99
protocol S{precedencegroup s{}

validation-test/compiler_crashers/28502-tok-isnot-tok-eof-lexing-past-eof.swift renamed to validation-test/compiler_crashers_fixed/28502-tok-isnot-tok-eof-lexing-past-eof.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
// See http://swift.org/LICENSE.txt for license information
66
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not --crash %target-swift-frontend %s -emit-ir
8+
// RUN: not %target-swift-frontend %s -emit-ir
99
// REQUIRES: asserts
1010
e(){precedencegroup

0 commit comments

Comments
 (0)