Skip to content

Resolve "polymorphic method binding"

Dan Newton requested to merge 55-polymorphic-method-binding into master

The client is now able to distinguish overloaded functions. It is not perfect as there is limited type information passed along in a json request.

ConcreteServiceExecutor now orders and filters out functions before checking the parameters of a function it is trying to match to.

Params.match now checks more than just the number of parameters. It checks the types to see what function it should try to match to. The ordering imposed by ConcreteServiceExecutor is important to this function since match will return the first function that it is able to match with.

JsonRPCRequest no longer checks the visibility of a function and matchesMethod has been split into separate functions.

Strings are now ranked above BigDecimal functions.

Lists, Arrays and Maps are now ranked to provide a deterministic ordering for class functions.

As of now, Arrays will always be ranked lower than Lists and therefore Lists will always be chosen over Arrays when a function is available.

On all Params functions take in KFunctions instead of Methods.

With this change, the client is now able to call nullable functions without issue. By using KFunctions and KParameters it is possible to determine if a type is nullable or not so when matching null values the correct function is chosen.

Closes #55 (closed)

Edited by Dan Newton

Merge request reports