Bug 13944 – Built-in stringof and mangleof properties are unnecessarily fixed to the type 'string'

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-06T09:16:00Z
Last change time
2015-02-18T03:41:55Z
Keywords
pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2015-01-06T09:16:28Z
Example code: struct S {} string cs = S.stringof; // OK wstring ws = S.stringof; // NG dstring ds = S.stringof; // NG The reason is that 'stringof' property makes a suffixed string literal "S"c rather than "S". The literal type is enforced to 'string' by the suffix, so it cannot be converted to '[wd]string'. The same issue exists on mangleof property. string cm = S.mangleof; // OK wstring wm = S.mangleof; // NG dstring dm = S.mangleof; // NG I think the restriction should be lifted.
Comment #1 by k.hara.pg — 2015-01-06T12:03:53Z
Comment #2 by github-bugzilla — 2015-01-06T13:21:38Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/06088d623430630fcd8598e18959d28024440bdf fix Issue 13944 - Built-in stringof and mangleof properties are unnecessarily fixed to the type 'string' https://github.com/D-Programming-Language/dmd/commit/b03c7e302edd32dd370a996122389b62571c2837 Merge pull request #4259 from 9rnsr/fix13944 Issue 13944 - Built-in stringof and mangleof properties are unnecessarily fixed to the type 'string'
Comment #3 by github-bugzilla — 2015-02-18T03:41:55Z
Commits pushed to 2.067 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/06088d623430630fcd8598e18959d28024440bdf fix Issue 13944 - Built-in stringof and mangleof properties are unnecessarily fixed to the type 'string' https://github.com/D-Programming-Language/dmd/commit/b03c7e302edd32dd370a996122389b62571c2837 Merge pull request #4259 from 9rnsr/fix13944