First life-signs of type functions

Steven Schveighoffer schveiguy at gmail.com
Tue May 12 01:44:45 UTC 2020


On 5/11/20 5:58 PM, Stefan Koch wrote:
> 
> In a type function alias cannot bind to values at all.
> It can only bind to symbols or types.

This seems like a problematic limitation. Aliases can bind to values 
when they are part of a tuple. This means that type functions are going 
to have to do weird template acrobatics to deal with mixed tuples.

For a long time, alias parameters wouldn't bind to int because it was a 
keyword, not a symbol, even though you could alias int as a declaration. 
It wouldn't even bind them to aliases of int (even though they are not 
keywords). That has since been fixed, and everything works great. I 
think we should avoid arbitrary limitations like this, even if it's 
harder to get it to work.

-Steve


More information about the Digitalmars-d mailing list