Extension type. Explicit unit test for isAlwaysExhaustive().

Change-Id: Ia589e9c81ab1d73fe0c31d8ec526405b854cf352
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/351161
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
Konstantin Shcheglov 2024-02-08 19:47:19 +00:00 committed by Commit Queue
parent 4fb4bdd24a
commit ee2754bac2

View file

@ -51,6 +51,26 @@ class IsAlwaysExhaustiveTest extends AbstractTypeSystemTest {
isAlwaysExhaustive(interfaceTypeQuestion(E));
}
test_extensionType() {
isAlwaysExhaustive(
interfaceTypeNone(
extensionType('A', representationType: boolNone),
),
);
isAlwaysExhaustive(
interfaceTypeNone(
extensionType('A', representationType: boolQuestion),
),
);
isNotAlwaysExhaustive(
interfaceTypeNone(
extensionType('A', representationType: intNone),
),
);
}
test_futureOr() {
isAlwaysExhaustive(futureOrNone(boolNone));
isAlwaysExhaustive(futureOrQuestion(boolNone));