implicit defaults for variant type parameters #4397
Comments
[@gavinking] Oh, of course, and:
Hah! |
[@FroMage] shared alias Variant => Nothing; And make the default |
[@gavinking] @FroMage hah! |
[@gavinking] I have implemented this. Along the way I found yet another reason to deprecate the use of {"helllo", "world"}.map(Singleton) In this, |
[@gavinking] This is done, but I need to update the spec. |
[@gavinking] I'm going to roll back this work. I believe this introduced undecidability, or near-undecidability. We can revisit it when we have #3641. |
[@gavinking] Reassigning to 1.5, alongside #3641. We need #3641, since the default type arg for a covariant type must always be exactly |
[@gavinking] By default:
Nothing
?That would let us write—in type expressions—
List
to meanList<Anything>
andIterable
to meanIterable<Anything,Null>
, without the need to explicitly specify any default type args.That way you would only need to explicitly specify a default type argument in the very rare case where it is invariant or different to the default defined above. I suspect that this boils down to never.
WDYT?
[Migrated from ceylon/ceylon-spec#1291]
The text was updated successfully, but these errors were encountered: