Closed
Description
#### General info
- Dart 3.5.4 (stable) (Wed Oct 16 16:18:51 2024 +0000) on "macos_arm64"
- on macos / Version 14.3.1 (Build 23D60)
The code below has different print results depending on debug and release modes.
debug : it is not String null
release: it is String null
void main() {
TestClass(type: TestType.a).run();
}
enum TestType {
a,
b,
}
class TestClass {
TestClass({
required this.type,
});
final TestType type;
String? get _subtitle {
return type == TestType.a ? null : 'test subtitle';
}
void run() {
if (_subtitle case String _) {
print('it is String $_subtitle');
} else {
print('it is not String $_subtitle');
}
}
}