December 04
On Friday, 4 December 2020 at 10:05:57 UTC, Timon Gehr wrote:
> On 04.12.20 09:38, Stefan Koch wrote:
>> On Friday, 4 December 2020 at 07:20:38 UTC, Mr T. wrote:
>>> [...]
>> 
>> SDC does detect the ambiguity.
>> 
>> uplink@uplink-black:~/ambig$ ../d/SDC/bin/sdc main.d
>> main.d:4:0: error: Already defined
>> int main() {
>>      return 0;
>> //    return
>> ...
>
>
> So does my frontend (https://github.com/tgehr/d-compiler):
>
> ---
> mb.d:5:10: error: declaration of 'Y' is invalid
>     enum Y = 64;
>          ^
> main.d:4:15: note: this lookup should have resolved to it otherwise
> immutable X = Y;    // no error!
>               ^
> ---
>
> Of course, it does not compile with versions of DMD newer than 2.060 due to, ironically, dependency issues. (Rainer once found a fix for the problem, but it caused some regressions.)
>
> There are various test cases here (many are for things other than dependency issues, but IIRC DMD chokes on quite a few of those too):
> https://github.com/tgehr/d-compiler/tree/master/test

Unfortunately I was reading the output wrongly ...
SDC rejected the main function itself because the name was clashing with the module name `main` :-/

Your front-end is more strict on this than SDC or DMD are.

Thanks for sharing your testcases.
I'll have a look as soon as I can dedicate some appropriate time.
Next ›   Last »
1 2