Skip to content

Conversation

@venkatd
Copy link

@venkatd venkatd commented Mar 12, 2025

Resolves #15

From the Elixir docs:

When invoked, ensure_compiled/1 and ensure_compiled!/1 halt the compilation of the caller until the module becomes available. Note that the distinction between ensure_compiled/1 and ensure_compiled!/1 is important: if you are using ensure_compiled!/1, you are indicating to the compiler that you can only continue if said module is available.

And then:

In most cases, ensure_loaded/1 is enough. ensure_compiled!/1 must be used in rare cases, usually involving macros that need to invoke a module for callback information. The use of ensure_compiled/1 is even less likely.

Code.ensure_loaded? does not guarantee that the module is available to call methods on. Because extending a type with Flint.Type requires calling functions on it, I believe Code.ensure_loaded? fixes the issue.

Our project is running on a fork for the time being.

@stanfordtax stanfordtax closed this by deleting the head repository Oct 12, 2025
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

Successfully merging this pull request may close these issues.

Extending Ecto.ParameterizedType with Flint.Type - compiler race condition

2 participants