[Issue 23361] New: std.uni.normalize should be pure
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Sep 23 10:23:40 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23361
Issue ID: 23361
Summary: std.uni.normalize should be pure
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: Ajieskola at gmail.com
-----------
@safe pure auto fun()
{ import std.uni;
return "a\u0308".normalize;
}
-----------
Errors, with both nightly and stable DMD:
onlineapp.d(3): Error: `pure` function `onlineapp.fun` cannot call impure
function `std.uni.normalize!(NormalizationForm.NFC, char).normalize`
There is nothing in `normalize` that should alter global state, so this should
compile.
I'm classifying this as major, because this is the only way to normalize
Unicode strings in D without a DIY or third-party library. The function not
being available in pure code is a serious hinderance.
--
More information about the Digitalmars-d-bugs
mailing list