Skip to content
New issue

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

VM doesn't treat strings as canonicalized in const expressions. #25024

Closed
lrhn opened this issue Nov 23, 2015 · 1 comment
Closed

VM doesn't treat strings as canonicalized in const expressions. #25024

lrhn opened this issue Nov 23, 2015 · 1 comment
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@lrhn
Copy link
Member

lrhn commented Nov 23, 2015

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

@lrhn lrhn added Type-Defect area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. labels Nov 23, 2015
@mhausner
Copy link
Contributor

mhausner commented Jan 5, 2016

Committed patchset #2 (id:20001) manually as
11a101a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

2 participants