Is binding to alias a definite superset of binding to a type parameter?

Meta jared771 at gmail.com
Tue May 26 16:04:17 UTC 2020


On Tuesday, 26 May 2020 at 11:33:04 UTC, Max Samukha wrote:
> On Monday, 25 May 2020 at 21:13:10 UTC, Stefan Koch wrote:
>> On Monday, 25 May 2020 at 20:58:56 UTC, Andrei Alexandrescu 
>> wrote:
>>> This seems to be an overlook:
>>>
>>> https://issues.dlang.org/show_bug.cgi?id=20863
>>>
>>> Are there any non-bug cases showing different treatment of 
>>> type parameters vs. alias parameters? I mean:
>>>
>>> template xyz(T) { ... }
>>>
>>> vs.
>>>
>>> template xyz(alias T) { ... }
>>>
>>> The second should "catch" everything the first does, and more.
>>
>> It used to be the case that alias parameters could not bind 
>> basic types.
>> Because they are not symbols.
>>
>> However I gather that this issue has been "worked around"
>> Therefore, an alias would bind to almost anything.
>> including any type.
>
> Why can't basic types just be made symbols? They are symbols in 
> more consistent languages (such as Haskell), where they are 
> implicitly declared in a built-in namespace.

It's a moot point since alias template parameters now accept 
built in types.


More information about the Digitalmars-d mailing list