D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2638 - auto string var should be invariant(char)[], not char[]
Summary: auto string var should be invariant(char)[], not char[]
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL: http://www.digitalmars.com/d/2.0/decl...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-01 12:34 UTC by Jerry Quinn
Modified: 2015-06-09 01:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2009-02-01 12:34:37 UTC
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 Jarrett Billingsley 2009-02-01 12:43:00 UTC
Uh, what compiler version are you using?  If you're using a D1 compiler, then it should be char[6].
Comment 2 Jerry Quinn 2009-02-01 13:04:12 UTC
(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 Jarrett Billingsley 2009-02-01 13:42:26 UTC
Both the D1 and D2 specs are on Digital Mars' site, so no, it's not unambiguous.
Comment 4 Jerry Quinn 2009-02-01 14:16:19 UTC
(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 Koroskin Denis 2009-02-01 16:53:53 UTC
shall we close the issue?
Comment 6 Brad Roberts 2009-02-01 16:59:37 UTC
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 Brad Roberts 2009-02-01 17:03:13 UTC
Fixed in svn revision 906, pending next release.
Comment 8 Leandro Lucarella 2009-12-07 15:02:02 UTC
Fixed 10 months ago (probably in DMD 2.025). It's unlisted in the changelog.