fix bug in type inference with Java overloaded constructors