Skip to content
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

Class should be a Class.class, a Class.class.class.class and so on. #4374

Closed
c910335 opened this issue May 3, 2017 · 2 comments
Closed

Class should be a Class.class, a Class.class.class.class and so on. #4374

c910335 opened this issue May 3, 2017 · 2 comments
Milestone

Comments

@c910335
Copy link
Contributor

c910335 commented May 3, 2017

Though I have mentioned this on Gitter, I think this issue should be submitted.

code

pp Class.class
pp Class.class.class
pp Class.is_a?(Class)
pp Class.is_a?(Class.class)
pp Class.is_a?(Class.class.class)
pp Class.is_a?(Class.class.class.class)
pp Class.is_a?(Class.class.class.class.class)
pp Class.is_a?(Class.class.class.class.class.class)
pp Class.class.is_a?(Class)
pp Class.class.is_a?(Class.class)

result

Class.class # => Class
Class.class.class # => Class
Class.is_a?(Class) # => true
Class.is_a?(Class.class) # => false
Class.is_a?(Class.class.class) # => true
Class.is_a?(Class.class.class.class) # => false
Class.is_a?(Class.class.class.class.class) # => true
Class.is_a?(Class.class.class.class.class.class) # => false
Class.class.is_a?(Class) # => true
Class.class.is_a?(Class.class) # => false

version

$ crystal -v
Crystal 0.22.0 (2017-04-22) LLVM 4.0.0

$ uname -srvmo
Linux 4.10.11-1-ARCH #1 SMP PREEMPT Tue Apr 18 08:39:42 CEST 2017 x86_64 GNU/Linux
rockwyc992 added a commit to rockwyc992/crystal that referenced this issue May 3, 2017
fixed crystal-lang#4374

VirtualMetaclassType#metaclass will use super(Type)#metaclass
but it should override this method like what MetaclassType#metaclass do.
rockwyc992 added a commit to rockwyc992/crystal that referenced this issue May 3, 2017
@ozra
Copy link
Contributor

ozra commented May 3, 2017

Awesome find! Haha

@rockwyc992
Copy link
Contributor

I fixed that.

rockwyc992 added a commit to rockwyc992/crystal that referenced this issue May 13, 2017
rockwyc992 added a commit to rockwyc992/crystal that referenced this issue May 13, 2017
fixed crystal-lang#4374

VirtualMetaclassType#metaclass will use super(Type)#metaclass
but it should override this method like what MetaclassType#metaclass do.
mverzilli pushed a commit that referenced this issue May 13, 2017
Compiler: fixed VirtualMetaclassType#metaclass

Fixes #4374
@mverzilli mverzilli added this to the Next milestone May 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants