Fix template parameter

Dom Disc dominikus at scherkl.de
Wed Aug 10 06:15:39 UTC 2022


On Tuesday, 9 August 2022 at 22:58:16 UTC, Paul Backus wrote:
> On Tuesday, 9 August 2022 at 22:36:23 UTC, Dom Disc wrote:
>> On Tuesday, 9 August 2022 at 22:32:23 UTC, Dom Disc wrote:
>>> On Tuesday, 9 August 2022 at 21:16:22 UTC, Paul Backus wrote:
>>>> Yes, this syntax allows anything that implicitly converts to 
>>>> `BigInt`;
>>
>> Oh, or do you mean I will get two different instances of the 
>> template, if I call it with two different types with implicit 
>> conversion?
>> That would make it even worse than the non-templated 
>> declaration!
>
> Yes, exactly.

Ok, then I consider this is a bug in Phobos that should be 
corrected.

All instances of

```D
foo(T : fixedType)(T x) { }
```
should be replaced by

```D
foo(fixedType x) { }
```



More information about the Digitalmars-d-learn mailing list