PROPOSAL: 'final' without explicit type

Florian Weimer fw at deneb.enyo.de
Wed Apr 1 08:56:27 PDT 2009


* Marek Kozieł:

> 	<T extends I1&I2,K extends I1&I2> void noInterection(T t,K k){
> 		if (boo)t=k; // Type mismatch: cannot convert from K to T
> 		...
> 	}

The assignment is not type-safe anyway, as the following modification
shows:


	<T extends I1&I2,K extends I1&I2> T noInterection(T t,K k){
		if (boo)t=k; // Type mismatch: cannot convert from K to T
		return t;
	}

This would allow to convert values of any type which implements I1 and
I2 to any other type which implements the two interfaces, which is
clearly bogus.

Consequently, I think your snippet doesn't show what you claim.



More information about the coin-dev mailing list