www.digitalmars.com         C & C++   DMDScript  
Archives

D Programming
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger
D.gnu
D

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics


digitalmars.D.bugs - [Issue 3065] New: error: this for variable needs to be Type not Type!(arguments).Type

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3065

           Summary: error: this for variable needs to be Type not
                    Type!(arguments).Type
           Product: D
           Version: 1.045
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dhasenan gmail.com


This message is vague because it does not include any template parameters the
type may have. It is especially galling because the arguments are included in
the second part and not the first.

One fix is expression.c:270, check if ad->type is null. If it is, use the
current code. Otherwise, use ad->type->toChars rather that ad->toChars.

The other fix is to have AggregateDeclaration::toChars return type->toChars if
type is not null.

Since the latter is more general, I favor it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 11 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3065





--- Comment #1 from Chris Wright <dhasenan gmail.com>  2009-06-11 16:35:33 PDT
---
Created an attachment (id=399)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=399)
implements the more general fix described

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 11 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3065





--- Comment #2 from Chris Wright <dhasenan gmail.com>  2009-06-12 17:27:05 PDT
---
Additionally, the fix I've found for this error is to access fields as:
(cast(typeof(this)this).field
or
this.tupleof[INDEX]

rather than the more typical:
this.field

My initial guess is that semantic is not being run on the relevant
AggregateDeclaration.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 12 2009