July 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2716





--- Comment #9 from Stewart Gordon <smjg@iname.com>  2009-07-14 05:38:02 PDT ---
(In reply to comment #8)
> > "storage class has no effect" seems to be the wrong wording.
> 
> I'll change it if you come up with a nicer error message. "cannot be auto" would've been consistent with other error messages of this kind, but I thought the "has no effect" one was nicer.

But "has no effect" reads to me to the effect that the compiler is supposed to just ignore it, rendering the fact that the error is generated confusing to the user.  How about "both auto and explicit type given"?

> > Firstly, it'll be a case of doesn't make sense rather than has no effect; secondly, this is making it not a storage class at all.
> 
> That's arguable. My reasoning was that as a do-nothing storage class, auto makes sense everywhere. Its only 'effect' is to allow type inference in the absence of another storage class.

The treatment of auto in this context as a storage class seems to be a hack to simplify parsing of declarations, which is useful only because of auto's ambiguity.  If we get rid of auto's ambiguity as is being suggested, we should get rid of this hack while we're at it.

More logical is to handle auto as a placeholder for a type in auto-typed declarations, as a direct part of the AutoDeclaration syntax (as I must've OUAT thought it already was).  Something like (using * and + with their regexp meanings)

AutoDeclaration:
    Attribute* auto Identifier = AssignExpression ;
    Attribute+ Identifier = AssignExpression ;
    Attribute* auto Attribute+ Identifier = AssignExpression ;

(this last form is for backward compatibility, but could be removed or
deprecated one day)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2716





--- Comment #10 from Stewart Gordon <smjg@iname.com>  2009-07-14 05:40:37 PDT ---
(In reply to comment #9)
> How about "both auto and explicit type given"?

Or even "both auto and explicit type given, use scope for RAII" for the benefit of returning D programmers and those otherwise trying to update legacy code.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2716





--- Comment #11 from Christian Kamm <kamm-removethis@incasoftware.de>  2009-07-14 09:35:40 PDT ---
I've switched the error message to "both auto and explicit type given". auto class C {} will still trigger the "storage class has no effect" one though. I don't think error messages of this kind are avoidable if you want to make directly applying inapplicable storage classes an error.

By the way, bug 3118 would benefit from having a list of attributes and declarations that should trigger an error if combined via direct application. I can't guarantee I'll find the time to work on it though.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 14, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2716





--- Comment #12 from Stewart Gordon <smjg@iname.com>  2009-07-14 10:23:04 PDT ---
(In reply to comment #11)
> I've switched the error message to "both auto and explicit type given". auto class C {} will still trigger the "storage class has no effect" one though. I don't think error messages of this kind are avoidable if you want to make directly applying inapplicable storage classes an error.

Probably 99% of poorly written error messages can be improved if only one stops to think about it.

How about "auto cannot be applied to classes" or "auto can only be applied to variable declarations"?  We could use the same format for all illegal uses of attributes.

Of course, the relevance of this to auto'll change when/if the grammar change proposed in comment 9 is implemented....

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 02, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2716


Haruki Shigemori <rayerd.wiz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #13 from Haruki Shigemori <rayerd.wiz@gmail.com> 2010-01-01 20:53:16 PST ---
(In reply to comment #1)
> An auto class and a scope class are the same thing.  What do you think auto means in this context?

I think "auto class" must be an error, because a scoped class is "scope class" already.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 02, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2716



--- Comment #14 from Stewart Gordon <smjg@iname.com> 2010-01-02 03:08:20 PST ---
(In reply to comment #13)
> (In reply to comment #1)
> > An auto class and a scope class are the same thing.  What do you think auto means in this context?
> 
> I think "auto class" must be an error, because a scoped class is "scope class" already.

This as a meaning of auto may have been removed from the spec, but AIUI it was never the intention to withdraw it the moment scope was introduced.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2716


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #421 is|0                           |1
           obsolete|                            |


--- Comment #15 from Brad Roberts <braddr@puremagic.com> 2010-05-18 00:36:52 PDT ---
Created an attachment (id=636)
Update previous patch to tip of svn

I've updated this diff to the the current tip of svn 493.

I altered the error messages to point suggest that the user probably wants to use the scope storage class when it finds the deprecated use of auto.

I've also run this through the dmd test suite (which needs some corresponding changes that I'll send to Walter privately).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 28, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2716


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #16 from Walter Bright <bugzilla@digitalmars.com> 2010-08-28 00:16:49 PDT ---
http://www.dsource.org/projects/dmd/changeset/639

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 28, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2716


Haruki Shigemori <rayerd.wiz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


--- Comment #17 from Haruki Shigemori <rayerd.wiz@gmail.com> 2010-08-28 01:09:13 PDT ---
Thank you for your great job!
However, this invalid code is accepted yet.

auto class A{} // <-- not "scope"
void main()
{
    scope a = new A();
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 28, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2716


Haruki Shigemori <rayerd.wiz@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #18 from Haruki Shigemori <rayerd.wiz@gmail.com> 2010-08-28 01:52:44 PDT ---
Oh! Sorry...
This issue is already fixed.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
1 2
Next ›   Last »