This code completely breaks the compiler:

JG someone at simewhere.com
Fri Aug 19 04:16:28 UTC 2022


On Friday, 19 August 2022 at 03:13:03 UTC, Ruby The Roobster 
wrote:
> On Friday, 19 August 2022 at 03:10:38 UTC, Ruby The Roobster 
> wrote:
>> This snippet compiles.  Even if `dsds` and `sadsad` are 
>> defined nowhere, this code compiles.
>>
>> [SNIP]
>>
>> The reason why this compiles is because of the varidic 
>> template parameter, `Mtypes`.
>>
>> Either there is something I'm missing, or the compiler 
>> completely breaks when it sees varidic template arguments.
>
> The only way to get the code to not compile is to actually call 
> the function.

I think it might help to post the entire code you think should 
not compile (which does). I guess you are aware that templated 
code is only "fully checked" when it is instantiated. E.g. this 
will compile.
```d
import std;

auto nonsense(T)(T t) {
return 5+"six";
}

void main() {
}
```





More information about the Digitalmars-d-learn mailing list