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
The major challenge of making it work with classes is knowing whether the super class conforms to Codable already or not. Currently there is no way for macros to know that, however after this pitch implemented and available it will be possible to do so.
Thanks @MartinLau7, the changes are ready in #48, branch class-support. You can comment out following lines in Package.swift to use a custom swift-syntax branch that has the required changes:
@soumyamahunt
I apologize for not being able to respond in time earlier. I was ill and had to take some time off.
I ran the tests locally as you instructed. Are the tests in the class-support branch currently available? When I run the unit tests, the Class section fails.
@soumyamahunt I apologize for not being able to respond in time earlier. I was ill and had to take some time off.
No issues, hope you are feeling better now.
I ran the tests locally as you instructed. Are the tests in the class-support branch currently available? When I run the unit tests, the Class section fails.
I meant playing with the feature as in writing some class models using the library. Unit test support for this macro feature hasn't been added in swift-syntax as well. Also, you don't need to run tests manually, CI takes care of that.
Activity
soumyamahunt commentedon Sep 14, 2023
Thanks @itzaks.
The major challenge of making it work with classes is knowing whether the
superclass conforms toCodablealready or not. Currently there is no way for macros to know that, however after this pitch implemented and available it will be possible to do so.itzaks commentedon Sep 16, 2023
I see, thanks! 🙂
MartinLau7 commentedon Dec 13, 2023
I noticed that this pitch was already implemented in 5.9.2
soumyamahunt commentedon Dec 14, 2023
Thanks for noticing this, didn't think they will add this feature to the new fix release. Now classes can be supported with some change.
soumyamahunt commentedon Dec 18, 2023
@MartinLau7 swift-syntax hasn't released the update in protocol requirement, it is present in main branch but hasn't been released yet.
This needs to be released as well for
MetaCodableto support this feature.MartinLau7 commentedon Dec 19, 2023
@soumyamahunt Thank you for your reply. I can assist with testing once a new version is released.
soumyamahunt commentedon Dec 19, 2023
Thanks @MartinLau7, the changes are ready in #48, branch
class-support. You can comment out following lines inPackage.swiftto use a custom swift-syntax branch that has the required changes:MetaCodable/Package.swift
Line 49 in c1a4284
MetaCodable/Package.swift
Line 63 in c1a4284
Let me know if you face any issues.
MartinLau7 commentedon Dec 26, 2023
@soumyamahunt
I apologize for not being able to respond in time earlier. I was ill and had to take some time off.
I ran the tests locally as you instructed. Are the tests in the class-support branch currently available? When I run the unit tests, the Class section fails.
soumyamahunt commentedon Dec 26, 2023
No issues, hope you are feeling better now.
I meant playing with the feature as in writing some class models using the library. Unit test support for this macro feature hasn't been added in swift-syntax as well. Also, you don't need to run tests manually, CI takes care of that.
MartinLau7 commentedon Dec 27, 2023
Thank you for your explanation. I have already tried the demo locally and it is working fine. Thank you for your help.
soumyamahunt commentedon Jan 9, 2024
@itzaks @MartinLau7 class support has been released:
itzaks commentedon Jan 16, 2024
Amazing. Thanks for all your work! Looking forward to test it.