File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4753,7 +4753,8 @@ bool MissingArgumentsFailure::diagnoseSingleMissingArgument() const {
4753
4753
auto anchor = getRawAnchor ();
4754
4754
if (!(isExpr<CallExpr>(anchor) || isExpr<SubscriptExpr>(anchor) ||
4755
4755
isExpr<UnresolvedMemberExpr>(anchor) ||
4756
- isExpr<ObjectLiteralExpr>(anchor)))
4756
+ isExpr<ObjectLiteralExpr>(anchor) ||
4757
+ isExpr<MacroExpansionExpr>(anchor)))
4757
4758
return false ;
4758
4759
4759
4760
if (SynthesizedArgs.size () != 1 )
@@ -5112,6 +5113,8 @@ MissingArgumentsFailure::getCallInfo(ASTNode anchor) const {
5112
5113
return std::make_pair ((Expr *)SE, SE->getArgs ());
5113
5114
} else if (auto *OLE = getAsExpr<ObjectLiteralExpr>(anchor)) {
5114
5115
return std::make_pair ((Expr *)OLE, OLE->getArgs ());
5116
+ } else if (auto *ME = getAsExpr<MacroExpansionExpr>(anchor)) {
5117
+ return std::make_pair ((Expr *)ME, ME->getArgs ());
5115
5118
}
5116
5119
return None;
5117
5120
}
Original file line number Diff line number Diff line change 6
6
// REQUIRES: executable_test
7
7
8
8
@expression macro stringify< T> ( _ value: T ) -> ( T , String ) = MacroDefinition . StringifyMacro
9
+ // expected-note@-1{{'stringify' declared here}}
9
10
@expression macro missingMacro1( _: Any ) = MissingModule . MissingType // expected-note{{'missingMacro1' declared here}}
10
11
@expression macro missingMacro2( _: Any ) = MissingModule . MissingType
11
12
@@ -40,6 +41,11 @@ struct ZZZ {
40
41
func test( a: Int , b: Int ) {
41
42
// FIXME: Bad diagnostic.
42
43
let s = #stringify < Int , Int > ( a + b) // expected-error{{type of expression is ambiguous without more context}}
44
+
45
+ _ = #stringify ( )
46
+ // expected-error@-1{{missing argument for parameter #1 in call}}
47
+ _ = #stringify ( label: a + b)
48
+ // expected-error@-1{{extraneous argument label 'label:' in call}}
43
49
}
44
50
45
51
func shadow( a: Int , b: Int , stringify: Int ) {
You can’t perform that action at this time.
0 commit comments