[Issue 1818] storage class in type tuples is discarded for function and delegate declarations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 7 11:10:38 PST 2008


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





------- Comment #1 from kamm-removethis at incasoftware.de  2008-02-07 13:10 -------
I have commented out the mentioned code in func.c and tested this with gdc.
While it works in the sense that

void foo(ref int i) { ++i; }
void bar(ParameterTypeTuple!(foo) f) { foo(f); }

now yields a bar taking a ref int, there are other issues. Most notably

template printT(T...)
{
  pragma(msg, T.stringof);
  alias T printT;
}
alias printT!(ParameterTypeTuple!(foo)) printed;

prints a mere (int). This seems to happen because tuples are split into types
when instantiating a template, losing their extra information. (template.c
TemplateInstance::semanticTiargs I think).

Looking at the whole issue again, it may be more sensible to remove storage
class information from type tuples altogether. After all, they are supposed to
hold types and not argument-specifications. As storage class manipulation is
essential in some instances, a new kind of tuple could be introduced:
ArgumentTuple?


-- 



More information about the Digitalmars-d-bugs mailing list