File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -5162,7 +5162,7 @@ void Parser::recordLocalType(TypeDecl *TD) {
5162
5162
return ;
5163
5163
5164
5164
if (!InInactiveClauseEnvironment)
5165
- SF.LocalTypeDecls .insert (TD);
5165
+ SF.getOutermostParentSourceFile ()-> LocalTypeDecls .insert (TD);
5166
5166
}
5167
5167
5168
5168
// / Set the original declaration in `@differentiable` attributes.
Original file line number Diff line number Diff line change @@ -235,11 +235,17 @@ func testStringifyWithThrows() throws {
235
235
236
236
// CHECK-DIAGS: @__swiftmacro_9MacroUser23testStringifyWithThrowsyyKF9stringifyfMf1_.swift:1:2: error: call can throw but is not marked with 'try'
237
237
#endif
238
-
238
+
239
239
// The macro adds the 'try' for us.
240
240
_ = #stringifyAndTry ( maybeThrowing ( ) )
241
241
}
242
242
243
+ func testStringifyWithLocalType( ) throws {
244
+ _ = #stringify({
245
+ struct QuailError: Error {}
246
+ throw QuailError()
247
+ })
248
+ }
243
249
244
250
@freestanding(expression) macro addBlocker<T>(_ value: T) -> T = #externalMacro(module: " MacroDefinition" , type: " AddBlocker " )
245
251
@@ -496,7 +502,7 @@ func testHasEqualsSelf(
496
502
_ = ( y == true ) // expected-error{{referencing operator function '=='}}
497
503
_ = ( z == true ) // expected-error{{referencing operator function '=='}}
498
504
_ = ( w == true ) // expected-error{{referencing operator function '=='}}
499
- #endif
505
+ #endif
500
506
501
507
// These should be found through the protocol.
502
508
_ = ( xP == true )
You can’t perform that action at this time.
0 commit comments