2.6.11

Java wildcards need taming

In this year's PLDI, there is a session where every paper starts with the gerund "Taming ... "
Seems like some computer science topics are inherently wild. And what else could these papers talk about than ... Java wildcards :)

Ok, ok, it's only two papers after all. Still, the shrewishness is real, because since Java wildcards were imposed upon programmers, we find ourselves running into weird situations where people need silly casts, or declare two variables of different types for the same value "to make the compiler happy".

Well, if you feel like turning it around and make the compiler unhappy for once, try feeding it this :)

// source:
// Ross Tate, Alan Leung, Sorin Lerner.
// Taming Wildcards in Java’s Type System. in PLDI 11

import java.util.List;
class C<P extends List<? super C<D>>> implements List<P> {}
class D implements List<C<? extends List<? super C<D>>>> {}

1 comment:

e6u1ho75w9 said...

Otherwise, they'd be within the position of people putting large sums of money on the playing desk when the roulette wheel is spinning. The Labouchère System is a development betting technique just like the martingale however doesn't require the gambler to danger their stake as quickly with dramatic double-ups. The Labouchere System includes using a series of numbers in a line discover out} the guess quantity, following a win or a loss. Typically, the participant provides the numbers at the front and end of the 제왕카지노 road discover out} the dimensions of the next guess. If the participant wins, they cross out numbers and continue working on the smaller line. If the participant loses, then they add their previous guess to the tip of the road and continue to work on the longer line.