mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
[ddc] Fix return type to avoid cast to bool
Now the call in `dtest()` (directly above) is known to never return so the type of `obj` can be promoted and there is no cast in the return statement. Change-Id: I9096dab87cfba5ea2289530070d0214974379ebc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155068 Reviewed-by: Mark Zhou <markzipan@google.com> Commit-Queue: Nicholas Shahan <nshahan@google.com>
This commit is contained in:
parent
b2ef76a4d1
commit
ca2da56786
|
@ -456,7 +456,7 @@ bool dtest(obj) {
|
|||
return obj;
|
||||
}
|
||||
|
||||
void booleanConversionFailed(obj) {
|
||||
Never booleanConversionFailed(obj) {
|
||||
var actual = typeName(getReifiedType(obj));
|
||||
throw TypeErrorImpl("type '$actual' is not a 'bool' in boolean expression");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue