Summary: functions are considered pointers
           Product: D
           Version: 1.051
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2009-12-26 09:45:34 PST ---
First off, this bug report is for dmd 1.053, not 1.051; but bugzilla let's me
only select up to 1.051.

The following code outputs "what (void())()", which shows that function
pointers are matched with is(T T2 : T2*). I think this shouldn't be the case:
although technically function pointers really are pointers, D doesn't declare
them using the pointer syntax, doesn't allow them to be dereferenced, and they
don't point to any type.

If this bug is fixed, functions won't match with is(T T2 : T2*) anymore.

If this is just an anti-feature and not a bug, please mark this bug report as

struct X {
    void function() foo;

void moo(T)() {
    static if (is(T T2 : T2*)) {
        pragma(msg, "what "~T2.stringof);

void main() {
    X x;
    foreach (int index, z; x.tupleof) {

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to