-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix(es/minifier): Check type of assignment target before merging assignments #9617
Conversation
🦋 Changeset detectedLatest commit: cbd7549 The changes in this PR will be included in the next version bump. 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 #9617 will create unknown performance changesComparing Summary
Benchmarks breakdown
|
Is collecting initial types enough? I think it can be useful for |
27af2aa
to
fe683cf
Compare
@kdy1 What do you think of this implementation? This looks more sound than the main branch at the cost of losing some completeness (some cases that can be optimized are not). |
I think it's quite a clever idea. Yeah, we have a merging function for merging characteristics of variables, and reusing it for types make sense I think. |
Description:
Collect types of vars, maybe other optimization could benefit from this:
merged_var_type: Option<Value<Type>>
When the variable is reassigned, the we merge the types with some simple rules:
None
+None
=None
None
+Some(ty)
=Some(ty)
Some(ty1)
+Some(ty2)
ifty1
==ty2
=Some(ty1)
Otherwise = Unknown
Related issue (if exists):
closes #8718