You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Mangler] Avoid mangling local discriminator for attached macros
If we're using the macro-specific local discriminator, we need to
make sure we avoid mangling the regular local discriminator in
`appendDeclName`, since that could prematurely kick local discriminator
assignment before type-checking has finished.
rdar://143834482
// expected-note@-1 {{in expansion of macro 'AccidentalCodeItem' on struct 'S' here}}
145
-
// CHECK-DIAGS: @__swiftmacro_9MacroUser018invalidDeclarationA0yyF5S_$l0L_18AccidentalCodeItemfMp_.swift:1:1: error: expected macro expansion to produce a declaration
145
+
// CHECK-DIAGS: @__swiftmacro_9MacroUser018invalidDeclarationA0yyF5S_$l018AccidentalCodeItemfMp_.swift:1:1: error: expected macro expansion to produce a declaration
146
146
147
-
structLocalThing1{
148
-
func f(){
149
-
#accidentalCodeItem
150
-
// expected-note@-1 {{in expansion of macro 'accidentalCodeItem' here}}
// expected-note@-1 {{in expansion of macro 'AccidentalCodeItem' on struct 'S' here}}
150
+
// CHECK-DIAGS: @__swiftmacro_9MacroUser018invalidDeclarationA0yyF5S_$l118AccidentalCodeItemfMp_.swift:1:1: error: expected macro expansion to produce a declaration
// FIXME: xpected-warning@-1 {{external macro implementation type 'MacroDefinition.BluhBlah' could not be found for macro 'missingMacro()'; 'MacroDefinition.BluhBlah' could not be found in library plugin '}}
// FIXME: xpected-warning@-1 {{macro implementation type 'MacroDefinition.NotMacroStruct' could not be found for macro 'notMacro()'; 'MacroDefinition.NotMacroStruct' is not a valid macro implementation type in library plugin '}}
669
+
670
+
// Because this is a method in a local decl, it ends up getting delayed, so
671
+
// we need to check it at the end of the file.
672
+
// FIXME: We either need to switch to using CHECK-DAG, or ideally teach
673
+
// the diagnostic verifier about macro expansion buffers.
674
+
func invalidDeclarationMacro2(){
675
+
structLocalThing1{
676
+
func f(){
677
+
#accidentalCodeItem
678
+
// expected-note@-1 {{in expansion of macro 'accidentalCodeItem' here}}
679
+
// CHECK-DIAGS: @__swiftmacro_9MacroUser0023macro_expandswift_elFCffMX[[@LINE-3]]_6_18accidentalCodeItemfMf_.swift:1:1: error: expected macro expansion to produce a declaration
0 commit comments