From e0b15762881f17ec6136cf4e159d3cef4b23c140 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Tue, 4 Sep 2018 20:19:53 +0000 Subject: [PATCH] Avoid a "missing_return" warning in isValidImplementation. 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 Reviewed-by: Kevin Millikin --- pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart index c143b6d433a4..70a9cd10045f 100644 --- a/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart +++ b/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart @@ -492,7 +492,7 @@ abstract class KernelClassBuilder } } - unhandled( + return unhandled( "${interfaceMember.runtimeType} and ${dispatchTarget.runtimeType}", "isValidImplementation", interfaceMember.fileOffset,