JimmyCushnie / JECS

Jimmy's Epic Config System
Do What The F*ck You Want To Public License
154 stars 16 forks source link

Better constructor shortcuts #14

Open JimmyCushnie opened 5 years ago

JimmyCushnie commented 5 years ago

If a type has two constructors that take the same number of parameters, it chooses whichever comes first for use in constructor shortcuts.

class Example
{
    public Example(int i)
    {

    }
    public Example(string s)
    {

    }
}

if we try to use ("this is a string") as a shortcut for an Example, there will be an error as it will try to use the int shortcut. What should happen is that if there are multiple constructors with the same number of parameters, it keeps trying them until either there is no error or all constructors have been tried.