-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Inconsistent inheritance in generics #9748
Comments
The fist And the first one might be related to #9660 For now, I would advice avoiding generic inheritance if possible. |
@asterite: thanks for the quick answer; I checked those two issues you mention beforehand and did not find a reference to instance variables - so I posted here... I still don't see it as duplicate. |
However |
I cannot follow you. In the API docs it reads: def self.<=(other : T.class) : Bool forall T # Returns whether this class inherits or includes other, or is equal to other.
is_a?(type : Class) : Bool # Returns true if self inherits or includes type. type must be a constant or typeof() expression. It cannot be evaluated at runtime. To me they sound almost alike, unless |
The receiver of |
got it, thanks; so I should have called |
Closing as duplicate of #2665 |
The following code shows three different (incompatible) flavors of generic inheritance:
Looks like a bug to me and I couldn't find it so far.
I'm using crystal 0.35.1 on Ubuntu.
The text was updated successfully, but these errors were encountered: