-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
Description
Example:
static interface Quantity<VALUE extends Number>
{
VALUE value();
}
static interface RealQuantity extends Quantity<Double>
{
// No additional methods
}
@Test
public void testRealQuantityWithGenericType()
{
Number fortyTwo = Double.valueOf(42D);
RealQuantity quantity = Projo.builder(RealQuantity.class).with(Quantity::value, fortyTwo).build();
assertEquals(Double.valueOf(42D), quantity.value());
}
@Test
public void testRealQuantityWithGenericTypeButSpecificValue()
{
RealQuantity quantity = Projo.builder(RealQuantity.class).with(Quantity::value, Double.valueOf(42D)).build();
assertEquals(Double.valueOf(42D), quantity.value());
}
@Test
public void testRealQuantityWithSpecificType()
{
RealQuantity quantity = Projo.builder(RealQuantity.class).with(RealQuantity::value, Double.valueOf(42D)).build();
assertEquals(Double.valueOf(42D), quantity.value());
}
The tests fail for both proxy-based implementation as well as for runtime code generation, though for slightly different reasons.
Reactions are currently unavailable