-
Notifications
You must be signed in to change notification settings - Fork 22
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
The reactive form model class cannot have a constructor with non-nullable fields #69
Comments
Hi. If it will change to non nullable - you have to regenerate the code. May be you can provide more details about your issue |
I've regenerated the code with the property as a non-nullable and it continued to treat it as nullable. That's essentially the issue I'm reporting. I've made some more changes and it's no longer doing that, but I'm not sure what caused it. Perhaps adding an I now have another similar issue where it's trying to pass the |
@vasilich6107 I've forked the repo and created two branches with updated examples to show the above issues.
If you need any more clarification just let me know, thanks! |
@vasilich6107 Any thoughts on the above? |
HI @efraimbart It generates slightly different code Login model becomes required no as far as it has non nullable required values to pass through |
case 2 fixed in reactive_forms_generator 0.23.3 |
The difference between my generated code and your generated code is probably because in the model I put |
Great, will try this in a bit. |
@efraimbart could you clarify if the issue is fixed |
I'm in the midst of a refactor so I haven't had a chance to try it yet, but I'll try to get to it very soon. |
Issue 2 seems resolved, but issue 1 still seems to be active. |
Hi @efraimbart |
Closing the issue as far as we fixed one thing and identified the fix for another one. |
When the generated code constructs the model class it uses null propagation to get the corresponding property from the original model instance, thereby attempting to pass in a nullable version of the expected property type.
An example of where this issue can be seen is in login_extended. It's only not an issue in this instance because
LoginExtended.unAnnotated
is nullable, but if it's changed to non-nullable it would cause a compile time error.The one example I've seen where it set the model as nullable, and therefore doesn't require null propagation when accessing it's properties, is in profile, but I don't know how to replicate.
The text was updated successfully, but these errors were encountered: