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

Add rb_define_class_id_under to the C API and update rb_define_class_under to raise a TypeError for a superclass mismatch #3613

Closed
yorickpeterse opened this issue Feb 5, 2016 · 4 comments
Labels
C-API Compatibility Function and feature compatibility with the MRI C-API

Comments

@yorickpeterse
Copy link
Contributor

This function is the same as rb_define_class_under except the name should be an ID instead of a const char *.

@yorickpeterse yorickpeterse added C-API Compatibility Function and feature compatibility with the MRI C-API Ruby 2.3 labels Feb 5, 2016
@yorickpeterse yorickpeterse changed the title Add rb_define_class_id_under to the C API Add rb_define_class_id_under to the C API and update rb_define_class_under to raise a TypeError for a superclass mismatch Feb 5, 2016
@yorickpeterse
Copy link
Contributor Author

From the 2.3 changelog:

rb_define_class_id_under() now raises a TypeError exception when the class is already defined but its superclass does not match the given superclass, as well as definitions in ruby level.

@chuckremes chuckremes mentioned this issue Feb 5, 2016
52 tasks
@yorickpeterse
Copy link
Contributor Author

@ahmadsherif Does our rb_define_class_id_under / rb_define_class_under raise TypeError in the case mentioned above?

@ahmadsherif
Copy link
Member

@yorickpeterse It does through rubinius::Helpers::open_class which in turn calls rubinius::Helpers::check_superclass.

@yorickpeterse
Copy link
Contributor Author

@ahmadsherif Ah OK. Thanks for looking into this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API Compatibility Function and feature compatibility with the MRI C-API
Projects
None yet
Development

No branches or pull requests

2 participants