ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

over-aggressive simplification to homogenous Tuple type #1440

Closed jvasileff closed 8 years ago

jvasileff commented 8 years ago

I don't know if this affects actual type checking, but the type inference information available in error messages and IDE mouseovers incorrectly simplifies Tuple intersections with Sequential to canonical, homogeneous Tuples, disregarding Tuple's type parameters that are not present in Sequential.

The mouseover on value for:

value seq = (nothing of <String|Integer>[2] & Integer[]);

is "Inferred type Integer[2]"

And the error message for:

value seq = (nothing of <String|Integer>[2] & Integer[]);
Integer[2] seq2 = seq;

sometimes says "Integer[2] is not assignable to Integer[2]".

gavinking commented 8 years ago

Is this a dupe of non-bug https://github.com/ceylon/ceylon-model/issues/6?

gavinking commented 8 years ago

Oh no, unlike ceylon/ceylon-model#6 it seems to be an actual bug. But like ceylon/ceylon-model#6 this is nothing to do with the typechecker itself, AFAICT, and is just a minor bug in TypePrinter in ceylon-model.

jvasileff commented 8 years ago

Sounds right

gavinking commented 8 years ago

Fixed.