-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialize fails when fetching class name from collection #2
Comments
That's expected, because You definitely need a class Base
macro subclasses
{
{% for subclass in @type.subclasses %}
{{subclass}}: {{subclass.id}},
{% end %}
}
end
# Or also
macro subclass(type)
{{ @type.subclasses.find { type.id } }}
end
end |
I reworded a bit error messages. Except that, the error is legitimate. |
This is ultimately what I needed. Thank you! My apologies on opening an issue on my own mistake! And thanks for the awesome explaination :) macro subclass(type)
{{ @type.subclasses.find { type.id } }}
end |
No problem @andrewc910 , glad to help! |
I missed the second bonus bug for Note a compile-time error will also happen when using I think it is fine for now, an option is to have a blacklist of unserializable stdlib objects that will be automatically ignored. |
This is a strange one. I played around quite a bit to recreate the bug every way i could.
Example code:
Error Message:
Edit: Bonus Bug - Didn't want to create another bug report for the watchers. Will do so if you would like me to.
Deserialization fails when a propertys default value is
IO::Memory.new
. This bug occurs with getter, setter and property keywords. I can get around it with@[Crystalizer::Field(ignore: true)]
as I don't need that property serialized. Just pointing it out.The text was updated successfully, but these errors were encountered: