feat(core): handle logical operators#6550
Conversation
🦋 Changeset detectedLatest commit: 54c7313 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CodSpeed Performance ReportMerging #6550 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
| // We need to look up the prototype chain, which may | ||
| // yield duplicate member names. We deduplicate | ||
| // using a map before constructing a new object. | ||
| let members: BTreeMap<Text, ResolvedTypeMember> = subject |
There was a problem hiding this comment.
Not relevant to this PR, but why do we order members based on their name, instead - for example - text range?
There was a problem hiding this comment.
Because it's not so much about ordering as it is about eliminating duplicates, and using text range wouldn't help with the latter. For instance, if we have these definitions:
class Base {
foo() {}
}
class Sub extends Base {
foo() {}
}foo() will exist twice in the prototype chain, but only the latter one should become part of the new object.
There was a problem hiding this comment.
Thank you. Would you mind a comment so we don't forget? Also, does the HashMap increase performance? Asking because last time this helped
There was a problem hiding this comment.
Will do, and I'll give it a shot with a hash table indeed :)
There was a problem hiding this comment.
Created an optimised implementation, but it doesn't change much. I should've expected that, since it only affects the creation of rest objects :)
cd5e653 to
54c7313
Compare
Summary
Type inference is now able to handle logical expressions:
&&,||, and??.Examples
Test Plan
Tests added.