Skip to content

Fix issue with comparison of string constants#6066

Merged
cristianoc merged 1 commit intomasterfrom
string_constants_compare
Mar 11, 2023
Merged

Fix issue with comparison of string constants#6066
cristianoc merged 1 commit intomasterfrom
string_constants_compare

Conversation

@cristianoc
Copy link
Copy Markdown
Collaborator

String constants were compare literally, as part of constant propagation. This means that for example "\a" == "a" was compiled to false even though the two represent the same strings. Unicode and hex escape codes are other examples where literal comparison is not correct.

Implemented a 3-way string comparison: equality returns Some(true), Some(false), or None where the result is not determined.

String constants were compare literally, as part of constant propagation.
This means that for example `"\a" == "a"` was compiled to `false` even though the two represent the same strings.
Unicode and hex escape codes are other examples where literal comparison is not correct.

Implemented a 3-way string comparison: equality returns Some(true), Some(false), or None where the result is not determined.
@cristianoc cristianoc force-pushed the string_constants_compare branch from 532b9d5 to b778dce Compare March 11, 2023 06:44
@cristianoc cristianoc merged commit 9fb5a89 into master Mar 11, 2023
@cristianoc cristianoc deleted the string_constants_compare branch March 11, 2023 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant