-
-
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
Support hierarchical record creation from generated dynamic factory #47
Labels
enhancement
New feature or request
Comments
kzu
added a commit
that referenced
this issue
Nov 9, 2022
We now invoke factories automatically whenever they are found. A new diagnostic is reported if a `Create(dynamic value)` factory method is found in the record but it's not accessible to the generated factory in the current assembly. The diagnostic is nevertheless a warning since in that case we still generate our custom factory, but users will not get the benefit of invoking their custom factory (although this might be by design if it's just a coincidence in the method name and signature they chose for an entirely unrelated purpose). Closes #47
kzu
added a commit
that referenced
this issue
Nov 9, 2022
We now invoke factories automatically whenever they are found. A new diagnostic is reported if a `Create(dynamic value)` factory method is found in the record but it's not accessible to the generated factory in the current assembly. The diagnostic is nevertheless a warning since in that case we still generate our custom factory, but users will not get the benefit of invoking their custom factory (although this might be by design if it's just a coincidence in the method name and signature they chose for an entirely unrelated purpose). Closes #47
kzu
added a commit
that referenced
this issue
Nov 9, 2022
We now invoke factories automatically whenever they are found. A new diagnostic is reported if a `Create(dynamic value)` factory method is found in the record but it's not accessible to the generated factory in the current assembly. The diagnostic is nevertheless a warning since in that case we still generate our custom factory, but users will not get the benefit of invoking their custom factory (although this might be by design if it's just a coincidence in the method name and signature they chose for an entirely unrelated purpose). Closes #47
kzu
added a commit
that referenced
this issue
Nov 9, 2022
We now invoke factories automatically whenever they are found. A new diagnostic is reported if a `Create(dynamic value)` factory method is found in the record but it's not accessible to the generated factory in the current assembly. The diagnostic is nevertheless a warning since in that case we still generate our custom factory, but users will not get the benefit of invoking their custom factory (although this might be by design if it's just a coincidence in the method name and signature they chose for an entirely unrelated purpose). Closes #47
kzu
added a commit
that referenced
this issue
Nov 10, 2022
We now invoke factories automatically whenever they are found. A new diagnostic is reported if a `Create(dynamic value)` factory method is found in the record but it's not accessible to the generated factory in the current assembly. The diagnostic is nevertheless a warning since in that case we still generate our custom factory, but users will not get the benefit of invoking their custom factory (although this might be by design if it's just a coincidence in the method name and signature they chose for an entirely unrelated purpose). Closes #47
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, say we have a couple records like:
When an event of type
OnDidDrawLine
coming from different assemblies is published,currently the subscriber will fail because the generated factory for it will essentially be
doing
new OnDidDrawLine(value.Line)
, and attempting to pass theLine
type from thewrong assembly to that constructor.
What we need is a generator that will instead generate
new OnDidDrawLine(Line.Create(value.Line))
where the
Line
factory method would in turn invoke thePoint
factory and so on. Thiswould allow supporting entire object hierarchies purely from generated factories.
Note that this does not involve the automatic creation of list-based properties, since
that would be a nice to have for another issue, perhaps.
The text was updated successfully, but these errors were encountered: