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

Issues with changes in scopedenums introduced in 2.2.1 #308

Open
jonalm opened this issue Mar 17, 2022 · 1 comment
Open

Issues with changes in scopedenums introduced in 2.2.1 #308

jonalm opened this issue Mar 17, 2022 · 1 comment

Comments

@jonalm
Copy link
Contributor

jonalm commented Mar 17, 2022

Context: The Arrow.jl 2.2.1 release changed the behavior of @scopedenums used in the FlatBuffer submodule, to remedy a type piracy issue. #267

This change introduced a couple of issues:

  1. Enum variabeles were exported from the module which wraps enum values. This pollutes the parent namespace.

export $(syms...)

Suggested fix: do not export the enum values by removing the above line

  1. The name of the module which wraps the the enum gets renamed with a trailing s or es

mod = Symbol(_typename_str, last(_typename_str) == 's' ? "es" : "s")

This is not ideal as the scoped enums often correspond to enums which are named and defined in a FlatBuffer schema file. Having custom rules to rename these names are confusing, and the renaming functionality must be shared by code generating functionality.

Suggested fix: Let the wrapping module share name with the enum name (as used in the flatbuffer schema), and let the primitive type (which lives inside that module) have the same name with a leading underscore. Accessing the enum values would thereby feel the same to the end user as before the 2.2.1 change (before 2.21 it was calling getproperty on an exported primitive type, with the proposed change one would access the a constant value inside a module).

@jonalm
Copy link
Contributor Author

jonalm commented Mar 17, 2022

@NHDaly

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

1 participant