Details
Description
When a class has a constructor, like:
class Person {
...
Person( String name, String likes, int age )
...
}
And someone writes code like:
new Person( "bob", 123, 456 )
MVEL should raise errors, since there is no constructor with a numeric parameter on the second argument. Although, MVEL is coercing 123 into a String and calling the constructor anyway. This is a coercion that is completely unexpected and most likely the user writing that code did not intended to use that constructor.
Also, non-existing constructors only generate error at runtime, when one would expect them to generate a compile time error. For instance, writing the following will only generate a runtime error, not a compile time error:
new Person( 1, 2, 3, 4, 5, 6, 7, 8, 9 )
I added a simple test case to CoreConfidenceTests.