Closed angelikatyborska closed 8 months ago
@jiegillet could you review this one?
GitHub doesn't seem to let me re-run the external tests, I can't find the button, I don't know why.
I can't find the button, I don't know why.
You can only rerun the tests if the latest test run isn't too old... I think maybe 2 or 4 weeks.
Ah that makes sense :)
Resolves https://github.com/exercism/elixir-analyzer/issues/407
Originally this PR was called:
After a deep dive, I realized that
assert_call
is already capable of finding calls in function heads.I have initially made a wrong assumption. I thought that the
Kernel
module alone is implicitly imported into each new module. That is only partially correct. TheKernel.SpecialForms
module is also implicitly imported, with some important differences:Kernel.SpecialForms
, whereas you can modifyKernel
imports by making them explicit and passing:only
/:except
optionsKernel.SpecialForms
macros cannot. They look exactly like usages of local function/macros.I was also confused which module provides which macro, I thought
<<>>
and::
comes fromKernel
, but it coems fromKernel.SpecialForms
TL;DR: we can use
assert_call called_fn name: :<<>>
to check for calls of special forms with no problems and no modifications necessary. It is not allowed to overwrite those special forms anyway, so you won't have a conflicting local function.Related PR: https://github.com/exercism/website-copy/pull/2306