-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Inconsistent mapping when mapping simple object to a constructor or property. #449
Comments
|
Can't 100% remember what that was meant to prove. It could be showing that Mapperly checks property names for complex objects when mapping to a constructor.
Interesting. Why does Mapperly make exceptions for constructors but not properties? |
Mapperly tries to use constructors by mapping property names to the constructor parameter names. This does not work for Tuples yet (see #448), however they don't match in this sample anyway.
What do you mean by making an exception? There is a |
That makes sense, thanks for clearing this up for me. |
The bug
Possible bug: I ran into trying to add mutliple mapping parameters.
Mapperly will map the source to a target constructor of the same type even if they don't have matching names. Mapperly will not map source to a property even if they have matching names.
To reproduce
Expected behaviour
Mapperly should either: use the source in target constructors if they have matching names and types or instead should not directly map the source as a parameter for contructors.
In the future to support #103 if the source/additional parameter matches a property it should assign to it.
This may require Mapperly to change how function reuse is done as it is currently name agnostic. This might??? lead to a situation where the order in which mappings are generated alters the generated code due to matching type signatures but different parameter names.
The text was updated successfully, but these errors were encountered: