File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -9502,9 +9502,8 @@ ParserResult<MacroDecl> Parser::parseDeclMacro(DeclAttributes &attributes) {
95029502 } else {
95039503 // Parameter list.
95049504 SmallVector<Identifier, 2 > namePieces;
9505- DefaultArgumentInfo defaultArgs;
95069505 auto parameterResult = parseSingleParameterClause (
9507- ParameterContextKind::Macro, &namePieces, &defaultArgs );
9506+ ParameterContextKind::Macro, &namePieces, nullptr );
95089507 status |= parameterResult;
95099508 parameterList = parameterResult.getPtrOrNull ();
95109509
Original file line number Diff line number Diff line change @@ -134,3 +134,8 @@ func testExternalMacroOutOfPlace() {
134134 let _: Int = #externalMacro( module: " A " , type: " B " )
135135 // expected-error@-1{{macro 'externalMacro' can only be used to define another macro}}
136136}
137+
138+ @freestanding ( expression)
139+ public macro macroWithDefaults( _: Int = 17 ) = #externalMacro( module: " A " , type: " B " )
140+ // expected-error@-1{{default arguments are not allowed in macros}}
141+ // expected-warning@-2{{external macro implementation type 'A.B' could not be found for macro 'macroWithDefaults'}}
You can’t perform that action at this time.
0 commit comments