Repository navigation
[record_use] Add Recordings.+ - #3510
Conversation
Package publishingIf you have publishing permissions, you can use the links below to publish the changes after merging this PR.
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
This check can be disabled by tagging the PR with Breaking changes ✔️
This check can be disabled by tagging the PR with |
d71510d to
34ea08f
Compare
| /// are combined in the returned [Recordings]. | ||
| Recordings merge(Recordings other) { | ||
| final newCalls = <DefinitionWithStaticCalls, List<CallReference>>{}; | ||
| for (final entry in calls.entries) { |
There was a problem hiding this comment.
DRY. This could be factored into a little util that merges maps.
Side note, you can merge them using a single map literal statement 😉, though it's definitely a matter of personal taste which you prefer:
Map<K, List<V>> _merge(Map<K, List<V>> a, Map<K, List<V>> b) => {
for (final k in {...a.keys, ...b.keys}) k: [...(a[k] ?? []), ...(b[k] ?? [])]
};There was a problem hiding this comment.
Done.
And renamed to the plus operator.
34ea08f to
a98ca86
Compare
Recordings.mergeRecordings.+
|
autosubmit label was removed for dart-lang/native/3510, because - The status or check suite build (windows, dev) has failed. Please fix the issues identified (or deflake) before re-applying this label. |
So we can combine two recordings.
Use case dart2wasm + dart2js compilation fallbacks in Flutter. Conditional imports can make it so that they are not necessarily a super set of each other, they might be disjoint. So picking one to default to does not give the right semantics.
Context:
package:record_useflutter/flutter#190225 (comment)