[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:
Nicholas Shahan 2020-07-21 22:38:06 +00:00 committed by commit-bot@chromium.org
parent b2ef76a4d1
commit ca2da56786

View file

@ -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");
}