Closed as not planned
Description
This yields the error A value of type "Object" can't be returned from the function 'func' because it has a return type of 'B'.
. This error does not occur using regular conditional syntax (if/else). I am using Dart 2.18.2, and this can be replicated on DartPad.
class A {}
class B {}
class C extends A implements B {}
class D extends A implements B {}
B func(bool b) => b ? C() : D();