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) {
51625162 return ;
51635163
51645164 if (!InInactiveClauseEnvironment)
5165- SF.LocalTypeDecls .insert (TD);
5165+ SF.getOutermostParentSourceFile ()-> LocalTypeDecls .insert (TD);
51665166}
51675167
51685168// / Set the original declaration in `@differentiable` attributes.
Original file line number Diff line number Diff line change @@ -235,11 +235,17 @@ func testStringifyWithThrows() throws {
235235
236236 // CHECK-DIAGS: @__swiftmacro_9MacroUser23testStringifyWithThrowsyyKF9stringifyfMf1_.swift:1:2: error: call can throw but is not marked with 'try'
237237#endif
238-
238+
239239 // The macro adds the 'try' for us.
240240 _ = #stringifyAndTry ( maybeThrowing ( ) )
241241}
242242
243+ func testStringifyWithLocalType( ) throws {
244+ _ = #stringify({
245+ struct QuailError: Error {}
246+ throw QuailError()
247+ })
248+ }
243249
244250@freestanding(expression) macro addBlocker<T>(_ value: T) -> T = #externalMacro(module: " MacroDefinition" , type: " AddBlocker " )
245251
@@ -496,7 +502,7 @@ func testHasEqualsSelf(
496502 _ = ( y == true ) // expected-error{{referencing operator function '=='}}
497503 _ = ( z == true ) // expected-error{{referencing operator function '=='}}
498504 _ = ( w == true ) // expected-error{{referencing operator function '=='}}
499- #endif
505+ #endif
500506
501507 // These should be found through the protocol.
502508 _ = ( xP == true )
You can’t perform that action at this time.
0 commit comments