-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add LazyMergedMap for merging Model objects #105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Yes, I think we almost certainly want this, the only way I could see avoiding it is if we require that macros only make one query.
There is a TODO for merging the model into the current scope here
macros/pkgs/dart_model/lib/src/scopes.dart
Line 162 in a482288
_accumulatedModel = model; |
which could directly use this, not sure if that's useful to do in this PR or not.
Oh nice, I will add that |
d22e3f4
to
0e1d468
Compare
_accumulatedModel = model; | ||
_typeSystem = null; | ||
if (_accumulatedModel case var accumulated?) { | ||
accumulated.mergeWith(model); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that should be _accumulatedModel = ...
:)
I guess we don't have any test coverage for this :) meaning we never use the type system after a second query.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly resolution to #102, not high priority to land right away just putting something out there.
Has a few failing tests right now which I can look at if we want to move forward.
We might want to benchmark this also if we decide to land it.