We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following tests fail due to the absent constant evaluation in patterns:
Consider the following program as an example:
String test(List value) { if (value case const <int>[1, 2]) { return "[1, 2]"; } return "other"; } main() { print(test(const <int>[1, 2])); }
When complied to Kernel currently, only one of const <int>[1, 2] is represented as a constant.
const <int>[1, 2]
library /*isNonNullableByDefault*/; import self as self; import "dart:core" as core; static method test(core::List<dynamic> value) → core::String { final core::List<dynamic> #t1 = value; if(#t1 =={core::List::==}{(core::Object) → core::bool} core::_GrowableList::_literal2<core::int>(1, 2)) { { return "[1, 2]"; } } return "other"; } static method main() → dynamic { core::print(self::test(#C3)); } constants { #C1 = 1 #C2 = 2 #C3 = <core::int*>[#C1, #C2] }
It prevents the equality to work for constants as expecting, resulting in failing tests. When the program shown above is run, it prints other.
other
The text was updated successfully, but these errors were encountered:
Related to #50629
Sorry, something went wrong.
This seems to have been fixed together with #50629
No branches or pull requests
The following tests fail due to the absent constant evaluation in patterns:
Consider the following program as an example:
When complied to Kernel currently, only one of
const <int>[1, 2]
is represented as a constant.It prevents the equality to work for constants as expecting, resulting in failing tests. When the program shown above is run, it prints
other
.The text was updated successfully, but these errors were encountered: