You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example:
const i = identical("ab", "a" + "b");
print(i); // false
This should print "true" - both "ab" and "a"+"b" are compile-time constant expressions, and so is calling identical on them. The result of a compile-time constant identical call on two compile-time constant strings should be true if the strings are equal.
It seems to be a problem with String.+. Other ways to dynamically build the string do not have the same problem:
const j = identical("ab", "${"a"}${"b"}");
print(j); // true
The text was updated successfully, but these errors were encountered:
Example:
const i = identical("ab", "a" + "b");
print(i); // false
This should print "true" - both "ab" and "a"+"b" are compile-time constant expressions, and so is calling identical on them. The result of a compile-time constant identical call on two compile-time constant strings should be true if the strings are equal.
It seems to be a problem with String.+. Other ways to dynamically build the string do not have the same problem:
const j = identical("ab", "${"a"}${"b"}");
print(j); // true
The text was updated successfully, but these errors were encountered: