-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-optimizationweb-dart2js
Description
After c5adfd2, dart2js inserts HtypeKnown nodes to track promotion
int tt() => 3;
main() {
final int? a = tt();
if (a != null) {
print('$a'); // promoted to `int`
}
final Object? b = tt();
if (b != null) {
print('$b'); // promoted to `Object`
}
}The generated main is
main() {
A.print("3");
A.print("" + 3);
}The HTypeKnown for promotion to int is removed (tt is inlined, so a is 3), but that for Object is not removed, impairing the constant folding of interpolation.
Metadata
Metadata
Assignees
Labels
area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.Issues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.dart2js-optimizationweb-dart2js