File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -658,9 +658,10 @@ class ScopeCreator final {
658
658
ASTScopeAssert (!n.isDecl (DeclKind::Accessor),
659
659
" Should not see accessors here" );
660
660
// Can occur in illegal code
661
+ // non-empty brace stmt could define a new insertion point
661
662
if (auto *const s = n.dyn_cast <Stmt *>()) {
662
663
if (auto *const bs = dyn_cast<BraceStmt>(s))
663
- ASTScopeAssert ( bs->empty (), " Might mess up insertion point " );
664
+ return ! bs->empty ();
664
665
}
665
666
return !n.isDecl (DeclKind::Var);
666
667
}
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend -typecheck %s 2>&1 | %FileCheck %s --check-prefix=CHECK-NO-ASSERTION
2
+
3
+ // Used to trip an assertion
4
+
5
+ public struct Foo {
6
+ func bar( ) {
7
+ var copySelf = self
8
+ repeat { copySelf
9
+
10
+ private extension String { }
11
+
12
+ // CHECK-NO-ASSERTION-NOT: Assertion
You can’t perform that action at this time.
0 commit comments