www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7385] New: Bad error message missing line number on invalid array op that isn't special cased

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

           Summary: Bad error message missing line number on invalid array
                    op that isn't special cased
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: yebblies gmail.com
        ReportedBy: yebblies gmail.com



void main()
{
    immutable double[] nums = [1.0, 2.0];
    nums[] /= nums[];
}

Prints:
DMD v2.058 DEBUG
Error: p1[p] isn't mutable

When it should print:
testx.d(12): Error: slice nums[] is not mutable

Normal because of the missing line number

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 28 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7385




This bug also bypasses gagging:

void main()
{
    immutable double[] nums = [1.0, 2.0];
    static assert(!is(typeof({ nums[] /= nums[]; })));
}

Still prints the error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7385


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
The second test no longer prints an error on 2.059

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 21 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7385





 This bug also bypasses gagging:
 
 void main()
 {
     immutable double[] nums = [1.0, 2.0];
     static assert(!is(typeof({ nums[] /= nums[]; })));
 }
 
 Still prints the error.
 The second test no longer prints an error on 2.059
The test case doesn't print error without -O switch, but with -O: $ dmd -O -run test Error: variable p1 used before set Error: variable p0 used before set It's another problem. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 14 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7385


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/1046

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 14 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7385




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/ab7dd67616d93585da5748646cd1f1070480a88f
fix Issue 7385 - Bad error message missing line number on invalid array op that
isn't special cased

This also fixes the problem of commented out test for issue 4662.
Just calling error() function cannot stop the code generation while gagging
errors. If errors exist, we should return ErrorExp.

https://github.com/D-Programming-Language/dmd/commit/c56169b1fb0c4191361127666a136611ae6f7b6b


Issue 7385 - Bad error message missing line number on invalid array op that
isn't special cased

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 14 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7385


Walter Bright <bugzilla digitalmars.com> changed:

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


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