apple / swift-syntax

A set of Swift libraries for parsing, inspecting, generating, and transforming Swift source code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Macro generated by other macro doesn't expand fully

jmgawecki opened this issue · comments

Description

The CoreDataManaged (memberAttribute and a few others that aren't relevant here) macro
Screenshot 2024-04-27 at 07 15 40
Expands to following, where CoreDataArray is now attached to the property entities
Screenshot 2024-04-27 at 07 17 32
Then, CoreDataArray (peer, accessor) macro expands but not fully, the peer expansion is missing from the viewer but I can confirm that the property has been in fact generated and and can be accessed.
Screenshot 2024-04-27 at 07 18 11

This is what happens when I attach the CoreDataArray myself:
Screenshot 2024-04-27 at 07 20 26

This looks like a bug to me when the macro expansions are interfering with each other somehow.
This was noted on both Swift 6.0 snapshot and Swift 5.10 release version running Xcode 15.3

This is an issue in Xcode, not with swift-syntax or the compiler. I just verified that sourcekitd (which provides semantic that raw expansion information to Xcode and lives in the compiler repo) does return the nested expansions, so I’m closing the issue.

I did pass the issue on to the Xcode team. If you are interested in seeing the status of that issue, I suggest that you file a feedback at https://feedbackassistant.apple.com.