You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bartosz Błaszków edited this page Jun 24, 2025
·
1 revision
Development
How to patch functions of OTP modules
Add module to patches/... if it doesn't exist yet.
Add a new implementation. In case of private function:
In Elixir you should make it public (otherwise it might get pruned)
and add @compile {:popcorn_patch_private, name: arity} before the definition.
In Erlang you should add -compile({popcorn_patch_private, name/arity}). (near the top of the file, before function definitions).
Without exporting it, the linter will complain, but that can be ignored.
To successfully compile the file:
Replace local calls (foo(...)) with :popcorn_module.foo(...)
(or popcorn_module:foo(...) in Erlang)
Copy or replace any module attributes, missing types and
struct definitions (in Erlang)
Comment each introduced change with Patch reason: explaining
why the change has been introduced.