Open munificent opened 5 years ago
This is a CFE bug:
library from "file:///tmp/x.dart" as x {
static method sum<T extends core::num = core::num>(x::sum::T value) → x::sum::T {
return 0 as x::sum::T;
}
static method main() → void {
core::double d;
core::print(x::sum<core::num>(d));
core::print(x::sum<core::double>(d).{core::num::isNaN});
}
}
Thanks, I wasn't sure where the in pipeline the bug happened, so I randomly picked "area-vm". :)
If I run this program:
On the bleeding edge VM:
I get:
Note the first zero. The first call to
sum()
succeeds even though that cast should certainly fail. Interestingly, the call toisNaN
apparently causes the cast inside the body of the function to be performed. I'm assuming some optimization pass is incorrectly eliminating the cast in the first call.