D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3980 - DMDFE confused about function pointer/whisper syntax when mixed with array indexing.
Summary: DMDFE confused about function pointer/whisper syntax when mixed with array in...
Status: RESOLVED DUPLICATE of issue 2392
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86_64 Linux
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-17 07:20 UTC by Thomas Brix Larsen
Modified: 2014-02-15 02:18 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Thomas Brix Larsen 2010-03-17 07:20:51 UTC
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;
}
Comment 1 Ellery Newcomer 2010-03-17 13:11:43 UTC
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 ***