Currently there is no way to check whether the current environment is something that user have written or it is generated by macro. There is technical workaround with checking `env.line == 0`, but IIRC it will not work when `location: :keep` is set. The reason for that is to be able to detect call to a function that is within code generated by macro. This is come up from my discussion with Jason Alexon on Slack when he was trying to implement https://github.com/axelson/priv_check which checks for function calls to the private (aka marked as `@doc false`) functions.
Such field could be a boolean, `mfa()` of the current macro, or even list of macro invocations. Any of these would be a helpful. I think the latter 2 options are most appealing, as it will allow for better control over the current context, so we could warn about calls from user-defined macros vs library-defined macros. -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/9c99baa3-776d-4da9-89e0-2c4412be3d0an%40googlegroups.com.