Files
sdk/pkg/front_end/testcases/nnbd/never_equals.dart.weak.expect
T
Johnni Winther 2414b293e1 [cfe] Throw error on exhaustive switch and expression of type Never
This requires a change to flow analysis that does not promote
expressions to Never through is-tests and equality tests.

Change-Id: Iec2ba5b78e61d205ad21dad6f07dbdb25fc746d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163380
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-09-25 08:35:03 +00:00

11 lines
758 B
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:_internal" as _in;
import "dart:core" as core;
static method test(Never nonNullableNever, Never? nullableNever) → dynamic {
Never v1 = let final Never #t1 = (let final Never #t2 = nonNullableNever in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")).==(let final Never #t3 = nonNullableNever in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")) in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
core::bool v2 = nullableNever.{core::Object::==}(nullableNever);
}
static method main() → dynamic {}