ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

bug in function type parameter variance checking #1378

Open gavinking opened 9 years ago

gavinking commented 9 years ago

The typechecker accepts this:

shared Boolean isInsideInterval<out Value>
        ([Value, Value] interval)(Value x)
        given Value satisfies Comparable<Value> 
        => let ([a,b]=interval) a <= x <= b;

That's inconsistent, since Value occurs contravariantly in the return type.

gavinking commented 9 years ago

This is pretty harmless and fixing it is too much of a PITA to bother with it for 1.2. I have added a comment indicating where the fix should go.