13c4ad23c5
This adds the static type of the switch statement expression to the AST to better support optimizations based on the possible runtime values of the switch expression. TEST=existing Change-Id: Ief35b687150401100d8c96721a026e9f0911b3b4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/301063 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Jens Johansen <jensj@google.com> Reviewed-by: Mayank Patke <fishythefish@google.com>
19 lines
531 B
Plaintext
19 lines
531 B
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/patterns/switchExpression_empty.dart:5:16: Error: The type 'dynamic' is not exhaustively matched by the switch cases since it doesn't match 'Object()'.
|
|
// Try adding a wildcard pattern or cases that match 'Object()'.
|
|
// f(x) => switch(x) {};
|
|
// ^
|
|
//
|
|
import self as self;
|
|
|
|
static method f(dynamic x) → dynamic
|
|
return block {
|
|
Never #t1;
|
|
#L1:
|
|
switch(x) /* isExplicitlyExhaustive, dynamic */ {
|
|
}
|
|
} =>#t1;
|