Closed
Description
Original customer issue: flutter/flutter#63740
Code that reproduces problem:
https://gist.github.com/rydmike/2e8e6a4cc9126dbe6f95e81e674f6d6b
The following BoxBorder.lerp/Border.lerp function is compiled from:
static Border? lerp(Border? a, Border? b, double t) {
assert(t != null);
if (a == null && b == null)
return null;
if (a == null)
return b!.scale(t);
if (b == null)
return a.scale(1.0 - t);
return Border(
top: BorderSide.lerp(a.top, b.top, t),
right: BorderSide.lerp(a.right, b.right, t),
bottom: BorderSide.lerp(a.bottom, b.bottom, t),
left: BorderSide.lerp(a.left, b.left, t),
);
}
// The caller
static BoxBorder? lerp(BoxBorder? a, BoxBorder? b, double t) {
assert(t != null);
if ((a is Border?) && (b is Border?))
return Border.lerp(a, b, t);
.......
to:
Border_lerp: function(a, b, t) {
///!!!!! NO null checks
return new F.Border(Y.BorderSide_lerp(a.top, b.top, t), Y.BorderSide_lerp(a.right, b.right, t), Y.BorderSide_lerp(a.bottom, b.bottom, t), Y.BorderSide_lerp(a.left, b.left, t));
},
BoxBorder_lerp: function(a, b, t) {
var t0, t2,
t1 = type$.nullable_Border;
if (t1._is(a) && t1._is(b))
return F.Border_lerp(a, b, t);
t1 = type$.nullable_BorderDirectional;