File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -953,8 +953,6 @@ void Lexer::lexDollarIdent() {
953
953
// independent of language mode.
954
954
return formToken (tok::identifier, tokStart);
955
955
} else {
956
- if (LangOpts.EnableDollarIdentifiers && !LangOpts.Playground )
957
- return formToken (tok::identifier, tokStart);
958
956
return formToken (tok::dollarident, tokStart);
959
957
}
960
958
}
Original file line number Diff line number Diff line change @@ -2915,6 +2915,12 @@ Expr *Parser::parseExprAnonClosureArg() {
2915
2915
auto closure = dyn_cast_or_null<ClosureExpr>(
2916
2916
dyn_cast<AbstractClosureExpr>(CurDeclContext));
2917
2917
if (!closure) {
2918
+ if (Context.LangOpts .DebuggerSupport ) {
2919
+ auto refKind = DeclRefKind::Ordinary;
2920
+ auto identifier = Context.getIdentifier (Name);
2921
+ return new (Context) UnresolvedDeclRefExpr (DeclName (identifier), refKind,
2922
+ DeclNameLoc (Loc));
2923
+ }
2918
2924
diagnose (Loc, diag::anon_closure_arg_not_in_closure);
2919
2925
return new (Context) ErrorExpr (Loc);
2920
2926
}
Original file line number Diff line number Diff line change
1
+ // RUN: not %target-swift-frontend %s -typecheck -debugger-support 2>&1 | %FileCheck %s --check-prefix=DEBUG
2
+ // RUN: not %target-swift-frontend %s -typecheck 2>&1 | %FileCheck %s --check-prefix=NODEBUG
3
+
4
+ // DEBUG: error: use of unresolved identifier '$0'
5
+ // NODEBUG: error: anonymous closure argument not contained in a closure
6
+ $0
You can’t perform that action at this time.
0 commit comments