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.
Suppose we wrote some
and some Ops to go with it. Then, we ask Ops for one of those
DoubleFunctions usingDoubleFunction df = env.op("fooOp", new Nil<DoubleFunction>(), new Nil[] {new Nil<Double>()}, new Nil<Double>())Currently, if ops can find a suitable
DoubleFunctionit will wrap it into aGenericTypedFunction, and then will encounter aClassCastException(because aGenericTypedFunctionis obviously not aDoubleFunction)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.