-
Notifications
You must be signed in to change notification settings - Fork 265
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
fix: Generate proper default string value for JavaScript #5239
Conversation
@@ -974,7 +974,7 @@ protected class ClassWriter : IClassWriter { | |||
return $"{DafnyMultiSetClass}.Empty"; | |||
} else if (xType is SeqType seq) { | |||
if (seq.Arg.IsCharType) { | |||
return "''"; | |||
return "_dafny.Seq.UnicodeFromString('')"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still support --unicode-char=false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call. The answer happens to be "yes", and I really mean "happens to". I changed the code to treat the two cases separately.
In writing more test cases, I also ran across the known non-uniformity with the printing of empty strings in Python. I was able to remove this non-uniformity for the default string.
Fixes #5238
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.