Skip to content

Improve Handling of IAEs in DefaultOpEnvironment.adaptOp #49

@gselzer

Description

@gselzer

This line is prone to throwing IllegalArgumentExceptions in calls such as

ops.op("namespace.name").inType(Foo.class, Bar.class).apply()

This call generates an OpRef looking for a BiFunction<Foo, Bar, Object>. If there is no satisfying BiFunction, adapt will try to look for an adaptor that can generate one. If adaptOpOutputSatisfiesRefTypes() can find an adapt Op to generate the appropriate BiFunction, the output O will not be assigned to a Type and thus substituteTypeVariables cannot substitute the O for some other Type.

Solutions include:

  1. Modifying inferTypeVariables to put some dummy type (i.e. an Any) into the Map
  2. Handling the error throwing within substituteTypeVariables better.

Unfortunately, I was rushed in thinking out this error report, so more details to come.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions