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
Thanks for the work you've done on this library! As someone who loves Sourcery mocks, it's no surprise someone would take advantage of Swift Macros to reimplement that functionality, so thanks for being that person!
Anywhoo, this is from the main branch as of today.
functions with nonescaping closures will cause Spyable to fail to compile, whereas escaping closures compile just fine:
As a sidenote, it also seems like indentation is off at lines 9 & 22.
For reference: The code generated in Sourcery's Automockable for the same protocol is this, which compiles:
Automockable.stencil has lots of checks that go something like if x and not hasNonEscapingClosures, so maybe something similar could be replicated here?
The text was updated successfully, but these errors were encountered:
Thanks for the work you've done on this library! As someone who loves Sourcery mocks, it's no surprise someone would take advantage of Swift Macros to reimplement that functionality, so thanks for being that person!
Anywhoo, this is from the
main
branch as of today.functions with nonescaping closures will cause
![Screenshot 2023-09-09 at 5 27 27 PM](https://private-user-images.githubusercontent.com/10556242/266807940-7c409750-56f4-4896-a47f-6d1f2aabe6f8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5MjI4NjcsIm5iZiI6MTczOTkyMjU2NywicGF0aCI6Ii8xMDU1NjI0Mi8yNjY4MDc5NDAtN2M0MDk3NTAtNTZmNC00ODk2LWE0N2YtNmQxZjJhYWJlNmY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDIzNDkyN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzYjJhNTIzZTVjZjVhNGQyMTc4OWNiNWVlNDZiNDg1ZWI5YzRhMjlkZDQ0YjEyZTAzZDg1YmZmN2U4ZTkxM2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.-x9tuSs2iHqzkfKmgXKvU8RABY0A7aa67bxLOOfkhZo)
Spyable
to fail to compile, whereas escaping closures compile just fine:As a sidenote, it also seems like indentation is off at lines 9 & 22.
For reference: The code generated in Sourcery's Automockable for the same protocol is this, which compiles:
It looks like this could be resolved by making spyable match automockable's behavior by having these two lines be removed for nonescaping closures:
Automockable.stencil has lots of checks that go something like
if x and not hasNonEscapingClosures
, so maybe something similar could be replicated here?The text was updated successfully, but these errors were encountered: