module main;

struct ThingOne
{
        int thing = 1;
}

struct ThingTwo
{
        float thing = 2;
}


struct Test
{
         ThingOne thing()
        {
                 return ThingOne();
        }
        
        ThingTwo thing()
        {
                return ThingTwo();
        }

}


void main()
{
        Test test;

        ThingOne thingOne = test.thing();
}


test.d(35): Error: main.Test.thing called with argument types () matches both:
test.d(17):     main.Test.thing()
and:
test.d(22):     main.Test.thing()

Why isn't the return type checked when resolving this? Only one of the choices would actually compile so there should be no ambiguity.

Reply via email to