[Issue 1354] Can use function prototype in typedef and alias.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 31 02:44:06 PDT 2007


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





------- Comment #2 from aziz.kerim at gmail.com  2007-07-31 04:44 -------
(In reply to comment #1)
> Why should having a typedef to a function type be an issue?
> 
> It might be but I'm not seeing it.
> 

The problem is that the compiler ignores the template parameter list. The
compiler should either flag this as an error or allow for such declarations.

A declaration like:

typedef A[] func(A, B)(B bla);

should be seen by the compiler as:

template func(A, B)
{
  typedef A[] func(B bla);
}

Instantiate template:

func!(int, int)* foo;


-- 



More information about the Digitalmars-d-bugs mailing list