Thread overview
[Issue 4293] New: Wrong line number with @disable
Jun 08, 2010
Jason House
Jun 08, 2010
Brad Roberts
Jun 08, 2010
Jason House
May 31, 2012
Kenji Hara
June 08, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4293

           Summary: Wrong line number with @disable
           Product: D
           Version: 2.041
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: jason.james.house@gmail.com


--- Comment #0 from Jason House <jason.james.house@gmail.com> 2010-06-07 19:16:47 PDT ---
$ cat test.d
struct x{
  @disable this(); // line 2
  this(bool b){ _b = b; }
  bool _b;
}
int main(){
  x; // line 7, the real source of the error
  return cast(int) x._b;
}
$ dmd test.d
test.d(2): Error: constructor test.x.this default constructor not allowed for
structs

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


Brad Roberts <braddr@puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |braddr@puremagic.com


--- Comment #1 from Brad Roberts <braddr@puremagic.com> 2010-06-07 21:26:49 PDT ---
Maybe there's a missing error at line 7, but the error from line 2 means what it says.. default (aka zero arg) ctors aren't allowed for structs.  Now, while I don't agree with that part of the d2 spec, that's a different issue.

ie, nothing to disable.

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



--- Comment #2 from Jason House <jason.james.house@gmail.com> 2010-06-08 03:31:12 PDT ---
My goal with doing this was to catch uses of the default constructor because in the original use case, it was always a bug.

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


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-05-30 17:41:55 PDT ---
In 2.060head, original code prints correct line number.

test.d(7): Error: type has no effect in expression (x)

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