http://d.puremagic.com/issues/show_bug.cgi?id=6351


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugd...@yahoo.com.au


--- Comment #1 from Don <clugd...@yahoo.com.au> 2011-08-24 04:48:25 PDT ---
Another test case, involving a variable instead of a delegate literal:

void bug6351(alias dg)()
{
    dg();
}

void delegate(int[] a...) deleg6351 = (int[] a...){};

alias bug6351!(deleg6351) baz6531;

The problem is in expression.c, functionParameters().
The parameter 'fd' is NULL, but the function calls fd->isSafe().
In fact, 'fd' will be null for any kind of call involving a variable -- TOKvar,
TOKdotvar, TOKindex, TOKstar, TOKcall, TOKdotti.

For the delegate literal case, we can determine 'fd' in expression.c 7618. This
will allow @safe inference for delegate literals as parameters.
For the variable case, the function type should be used instead of fd.

Lcheckargs:
    assert(tf->ty == Tfunction);

+    if (!f && e1->op == TOKfunction)
+    {
+        f = ((FuncExp *)e1)->fd;
+    }

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

Reply via email to