Skip to content

Fix wrapping errors with subinterfaces #52

@gselzer

Description

@gselzer

Suppose we wrote some

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

and some Ops to go with it. Then, we ask Ops for one of those DoubleFunctions using

DoubleFunction df = env.op("fooOp", new Nil<DoubleFunction>(), new Nil[] {new Nil<Double>()}, new Nil<Double>())

Currently, if ops can find a suitable DoubleFunction it will wrap it into a GenericTypedFunction, and then will encounter a ClassCastException (because a GenericTypedFunction is obviously not a DoubleFunction)

The solution to this problem involves changing DefaultOpEnvironment.getWrapperClass(). It might be that we should only wrap if there is a wrapper for the direct superInterface of a particular Op.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions