Enums - probably an old subject

Steve Teale steve.teale at britseyeview.com
Thu Nov 21 10:36:46 PST 2013


>>
>> BOOM! Code no longer compiles.
>>
>> As a rule, the code that compiles and works should preserve 
>> its behavior when new code is added, so this is prohibited.
>>
>> Also please post to D.learn
>
> forgot to add:
>
> void foo(OtherIntention rth) { ... }
>
> Which of the two is being called by main?

I thought that compilers were supposed to help you if you did 
ambiguous things. An interesting example is:

int bar(int n)
{
    return n+1;
}

int bar(int n)
{
    return n+2;
}

void main()
{
    int v = 22;
    int n = bar(22);
}


More information about the Digitalmars-d mailing list