Bug 2638 – auto string var should be invariant(char)[], not char[]

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-02-01T12:34:00Z
Last change time
2015-06-09T01:21:00Z
Assigned to
nobody
Creator
jlquinn

Comments

Comment #0 by jlquinn — 2009-02-01T12:34:37Z
auto s = "string"; // s is type char[6] Unless I'm misreading the spec, the type of s should be invariant(char)[6].
Comment #1 by jarrett.billingsley — 2009-02-01T12:43:00Z
Uh, what compiler version are you using? If you're using a D1 compiler, then it should be char[6].
Comment #2 by jlquinn — 2009-02-01T13:04:12Z
(In reply to comment #1) > Uh, what compiler version are you using? If you're using a D1 compiler, then > it should be char[6]. Sorry, I'm referring to D2. Also, this is an issue with the spec web page, so the language version is in the URL and unambiguous :-)
Comment #3 by jarrett.billingsley — 2009-02-01T13:42:26Z
Both the D1 and D2 specs are on Digital Mars' site, so no, it's not unambiguous.
Comment #4 by jlquinn — 2009-02-01T14:16:19Z
(In reply to comment #3) > Both the D1 and D2 specs are on Digital Mars' site, so no, it's not > unambiguous. > The URL includes 2.0 in the path. But I'll try to remember to set the version next time, sorry.
Comment #5 by 2korden — 2009-02-01T16:53:53Z
shall we close the issue?
Comment #6 by braddr — 2009-02-01T16:59:37Z
Why? string literals should be invariant in D2, so if that's not what's happening, then there's really a bug here. Is this report strictly a documentation bug or was there also code associated to demonstrate the problem? I'm assuming it's strictly a doc issue at the moment.
Comment #7 by braddr — 2009-02-01T17:03:13Z
Fixed in svn revision 906, pending next release.
Comment #8 by leandro.lucarella — 2009-12-07T15:02:02Z
Fixed 10 months ago (probably in DMD 2.025). It's unlisted in the changelog.