Skip to content

Handle isSafeAssignable failures when Op interface does not declare a functional method #51

@gselzer

Description

@gselzer

It is not a stretch to envision someone writing:

public interface DoubleFunction extends Function<Double, Double> {}

And while it is good practice to declare the functional method Double apply(Double in);, I don't know that we should require it.

At the very least, we should ensure that the matcher throws an informative, suitable error when asked for a DoubleFunction. Currently, an IndexOutOfBoundsException is thrown here. At the very least, we should throw some IllegalArgumentException. It would be even cooler if we could just find the functional interface within Function.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions