Files
sdk/pkg/front_end/testcases/expression/issue52905.expression.yaml
T
Johnni Winther 33fcaec0f1 [cfe] Handle exhaustiveness checking in expression evaluation
The expression evaluator called directly into the constant evaluator,
skipping the setting up of the exhaustiveness cache used for
exhaustiveness checking.

Closes #52905

Change-Id: I367ff73d8e23127811f99dfbf451e66eef452443
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/314060
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2023-07-18 10:17:49 +00:00

42 lines
904 B
YAML

# Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
sources: |
class Color {
final String name;
Color(this.name);
}
class Theme {
Color get primary => Color('primary');
Color get white => Color('white');
Color get transparent => Color('transparent');
}
enum _Type {
primary,
background,
outline,
text,
}
class Class {
final _Type _type;
final Theme theme;
final Color? backgroundColor;
Class(this._type, this.theme, this.backgroundColor);
method() {
}
}
definitions: []
position: "#Class"
expression: |
switch (_type) {
_Type.primary => theme.primary,
_Type.background => theme.white,
_Type.outline || _Type.text => theme.transparent,
}