www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3980] New: DMDFE confused about function pointer/whisper syntax when mixed with array indexing.

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

           Summary: DMDFE confused about function pointer/whisper syntax
                    when mixed with array indexing.
           Product: D
           Version: 1.057
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: brix brix-verden.dk


--- Comment #0 from Thomas Brix Larsen <brix brix-verden.dk> 2010-03-17
07:20:51 PDT ---
http://dsource.org/projects/ldc/ticket/402

struct Stdout
{
  static Stdout opCall(int i = 0) { Stdout s; return s; }
}

void main()
{
  int[char[]] b;

  Stdout(b["hello"])(); // error, DMDFE thinks you want to declare b
                        // of type Stdout["hello"]

  int (funcptr[4])(); // declares int[4] funcptr;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 17 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3980


Ellery Newcomer <ellery-newcomer utulsa.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |ellery-newcomer utulsa.edu
         Resolution|                            |DUPLICATE


--- Comment #1 from Ellery Newcomer <ellery-newcomer utulsa.edu> 2010-03-17
13:11:43 PDT ---
This exact same thing bit me a long time ago. Caused by denial that dmd's
parser grammar is context sensitive (or at least infinitely ambiguous).

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

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