ceylon/ceylon-spec

over-aggressive simplification to homogenous Tuple type

Closed this issue · 4 comments

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]".

Is this a dupe of non-bug ceylon/ceylon-model#6?

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.

Sounds right

Fixed.