Consider the following example (extracted from _SecureFilterImpl.SIZE):
final x = 8 * 1024;
void main() {
print(x);
}
When this example is compiled in AOT mode, there is still multiplication in kernel AST:
[@vm.inferred-type.metadata=int?] static final field core::int x = [@vm.direct-call.metadata=dart.core::_IntegerImplementation::*] [@vm.inferred-type.metadata=int?] 8.{core::num::*}(1024);
Constant evaluator can evaluate such expressions even though they are used in non-constant contexts.
After constant evaluation, TFA could infer a concrete type (Smi) of a resulting constant.
Consider the following example (extracted from _SecureFilterImpl.SIZE):
When this example is compiled in AOT mode, there is still multiplication in kernel AST:
Constant evaluator can evaluate such expressions even though they are used in non-constant contexts. After constant evaluation, TFA could infer a concrete type (Smi) of a resulting constant.
/cc @mkustermann @mraleph