-
-
Notifications
You must be signed in to change notification settings - Fork 664
feat(core): handle logical operators #6550
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do, and I'll give it a shot with a hash table indeed :)
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.
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.