-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specialized type tests #688
Comments
Oh, and another related thing, as the above examples demonstrate, I end up going |
@tombentley why can't you use |
That would be nice, I agree. |
Because I keep forgetting we have use-site variance I suppose. |
@gavinking is there a reason why |
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. |
Moving to 1.3. |
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"
.The text was updated successfully, but these errors were encountered: