March 20, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3994

           Summary: Wrong line numbers inside AA/Array initializers
           Product: D
           Version: 1.050
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: cbkbbejeap@mailinator.com
            Blocks: 977


--- Comment #0 from Nick Sabalausky <cbkbbejeap@mailinator.com> 2010-03-20 12:15:03 PDT ---
------------------------------
import std.stdio;
void main()
{
    int i;
    auto arr = [
        i,
        __LINE__,//xxx, // Expected number of this line
        i
    ]; // Outputs this line number
    writeln(arr[1]);
}
------------------------------
void main()
{
    int i;
    auto arr = [
        i,
        xxx, // Error should be reported here
        i
    ]; // Error actually reported here
}
------------------------------

The above problem holds for both arrays and assoc arrays. Problem does not occur for array literals or assoc array literals.

This is a real pain for a particular idiom I find very useful, particularly for handling domain-specific languages:

------------------------------
auto dgMap = [
    "foo": (Foo f) {
        return /+..stuff..+/;
    },
    "bar": (Foo f) {
        return /+..stuff..+/;
    },
    "bat": (Foo f) {
        return /+..stuff..+/;
    },
];
dgMap["bar"](new Foo())
------------------------------

Issue #977 is a special case of this issue.

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


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from yebblies <yebblies@gmail.com> 2012-02-02 13:58:42 EST ---
Same issue - array initializers get the wrong locations assigned.

*** This issue has been marked as a duplicate of issue 977 ***

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