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

Conflict of is_struct with Kernel.is_struct #4

Closed
lorenzosinisi opened this issue May 4, 2020 · 4 comments
Closed

Conflict of is_struct with Kernel.is_struct #4

lorenzosinisi opened this issue May 4, 2020 · 4 comments

Comments

@lorenzosinisi
Copy link
Contributor

Hello! I was trying to use Brex within an app using:

Erlang/OTP 22 [erts-10.7] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.10.2 (compiled with Erlang/OTP 22)

On MacOS 10.15.4

And I got an error of compilation of Brex because of a conflict on is_struct defined in Brex.Rule.Struct at line 32.

I have solved the issue and got the compiler to pass by changing it from is_struct to is_a_struct and changing the function name in that file so that there is no conflict. Do you think that it would make sense to open a PR?

@janpieper
Copy link

janpieper commented May 4, 2020

Instead of renaming is_struct/1 to is_a_struct/1, one could remove it and use the native is_struct/1 from Elixir.

@sascha-wolf
Copy link
Collaborator

sascha-wolf commented May 4, 2020

Removing is no option, as that would break compatibility with Elixir versions below 1.10. Also the Kernel version operates on an actual struct while the helper here operates on a module, which makes this whole point moot.

I suggest to rename to is_struct_module. If you want to open a PR that would be welcome. A PR should also update the Travis config to check for newer Elixir and Erlang combinations. I expect that certain combinations would have to be excluded because newer Elixir versions won't be compatible with older Erlang versions.

@lorenzosinisi
Copy link
Contributor Author

cool @sascha-wolf , done #5

@sascha-wolf
Copy link
Collaborator

Closed in #5

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

3 participants