I'm seeing some unexpected behavior with using ExtensionMacro. According to SE-0402^1 we can expect that an ExtensionMacro applied to a nested type will generate an extension at top-level. I am testing with an ExtensionMacro example from the swift-syntax repo and I am seeing the extension generated at local scope:
Description
https://forums.swift.org/t/extensionmacro-on-a-nested-type-does-not-generate-extension-at-top-level/71349
I'm seeing some unexpected behavior with using
ExtensionMacro
. According toSE-0402
^1 we can expect that anExtensionMacro
applied to a nested type will generate anextension
at top-level. I am testing with anExtensionMacro
example from theswift-syntax
repo and I am seeing the extension generated at local scope:Expands to:
Reproduction
Here is a diff on swift-syntax to repro:
Expected behavior
Similar behavior to
assertMacroExpansion
.Environment
Xcode 15.3 and Swift-Syntax 510.0.1.
Additional information
No response