Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

bug in function type parameter variance checking #4484

Open
CeylonMigrationBot opened this issue Jul 9, 2015 · 1 comment
Open

bug in function type parameter variance checking #4484

CeylonMigrationBot opened this issue Jul 9, 2015 · 1 comment

Comments

@CeylonMigrationBot
Copy link

[@gavinking] 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.

[Migrated from ceylon/ceylon-spec#1378]

@CeylonMigrationBot
Copy link
Author

[@gavinking] 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants