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

Unexpected warning in macro calls from dependencies after upgrading to Elixir 1.16.0-rc.0 #13091

Closed
marcelotto opened this issue Nov 9, 2023 · 1 comment

Comments

@marcelotto
Copy link
Contributor

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.16.0-rc.0 (792d4cc) (compiled with Erlang/OTP 26)

Operating system

MacOS Sonoma 14.1

Current behavior

After upgrading to Elixir v1.16.0-rc.0, I started receiving a warning when using a macro from the ExVCR test dependency. This was not the case with the previous Elixir version (1.15.4) and the warning is raised from the expanded code of the dependency, which is not directly under my control.

Here's the code causing the warning:

defmodule Magma.Generation.OpenAITest do  
  use Magma.TestCase  
  use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney

end

When running the tests, the following warning is emitted:

warning: parentheses are required for function calls with no arguments, got: ExVCR.Adapter.Hackney.module_name
│
3 │   use ExVCR.Mock, adapter: ExVCR.Adapter.Hackney
│   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
│
└─ test/magma/generation/open_ai_test.exs:3: Magma.Generation.OpenAITest (module)

Expected behavior

The expected behavior is that the use of macros from dependencies should not result in warnings.

@josevalim
Copy link
Member

It is actually not true that all warnings in macros are not emitted. We don't emit warnings that may be false positives, for example, variables defined by a macro that may be picked by another macro. In this case, there is no possibility of false positive here, and you should submit a PR to the package. :) Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants