dart2js: Imprecise type inference and type propagation on ||
condition
#26835
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
dart2js-optimization
web-dart2js
The code below, compiled with
contains an interceptor call for
externalUrl.startsWith('#')
, i.e.The dumpinfo output shows AA.x is
[null|exact=JSString]
, so global type inference does not determine externalUrl cannot benull
.Further, SSA type propagation does not clean up the type.
So both 'passes' fail to be precise enough.
Changing the first 'if' to two 'if' statements generates the expected code for the return expression:
out.js:
bug6j1a.dart:
The text was updated successfully, but these errors were encountered: