-
Notifications
You must be signed in to change notification settings - Fork 62
Specialized type tests #5566
Comments
[@tombentley] Oh, and another related thing, as the above examples demonstrate, I end up going |
[@gavinking] @tombentley why can't you use |
That would be nice, I agree. |
Because I keep forgetting we have use-site variance I suppose. |
[@tombentley] @gavinking is there a reason why |
[@gavinking] Well, so we can change that design later. I mean there's not really a huge difference between a "span" and a "measure", they are much the same thing. |
[@FroMage] Moving to 1.3. |
[@tombentley] While working on serialization I've come across the need to know about the types of instances at runtime which our existing metamodel APIs don't satisfy very well.
Array
is invariant I can't useis Array<Anything>
. The best I have currently istype(instance).declaration ==
class Array`` which is hardly egronomic and (given all I really need to do is aninstanceof
must perform terribly too).Span
from aMeasure
. BecauseSpan
andMeasure
are not shared from the language module I can't useis Span<Integer>
for example, because utteringSpan
is verboten. My work around for this is the positively spine chillingtype(instance).declaration.qualifiedName == "ceylon.language::Span"
.[Migrated from ceylon/ceylon.language#688]
The text was updated successfully, but these errors were encountered: