Skip to content

Commit

Permalink
Avoid a "missing_return" warning in isValidImplementation.
Browse files Browse the repository at this point in the history
The analyzer can't tell that `unhandled` is guaranteed not to return,
so it thinks that `isValidImplementation` might exit without returning
a value.  An easy workaround is to turn the call to `unhandled` into a
`throw`.

This is needed to roll kernel into the internal Google codebase, in
which the "missing_return" warning causes build failures.

Change-Id: Ia88b6cdef3693ab4646470616c7f868c5bad0502
Reviewed-on: https://dart-review.googlesource.com/72900
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
  • Loading branch information
stereotype441 authored and commit-bot@chromium.org committed Sep 4, 2018
1 parent 4c9b53f commit e0b1576
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ abstract class KernelClassBuilder
}
}

unhandled(
return unhandled(
"${interfaceMember.runtimeType} and ${dispatchTarget.runtimeType}",
"isValidImplementation",
interfaceMember.fileOffset,
Expand Down

0 comments on commit e0b1576

Please sign in to comment.