Skip to content
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.

Documented example causes "warning: variable does not exist" (but runs fine?) #44

Open
nathanalderson opened this issue Jun 24, 2022 · 1 comment

Comments

@nathanalderson
Copy link

nathanalderson commented Jun 24, 2022

Elixir and Erlang/OTP versions

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

Elixir 1.13.4 (compiled with Erlang/OTP 24)

Operating system

Linux (arch)

Current behavior

I am trying to use ExUnit.Parameterized. If I try to run the exact example module in the documentation, then I get a warning on this line:

  # support Callback as `context`
  test_with_params "add params with context", context,
    fn (a, b, expected) ->
      assert a + b == expected
    end do
      [
        {context[:value], 2, 3}  # *** warning here
      ]
  end

The warning is warning: variable "context" does not exist and is being expanded to "context()", please use parentheses to remove the ambiguity or change the variable name

Interestingly, if I disable warnings as errors the test runs and passes just fine.

Expected behavior

No warning is issued.

@KazuCocoa
Copy link
Owner

yes, the warning is currently expected. I don't remember well what I tried before... but the current implementation does not fix the warning yet.

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

No branches or pull requests

2 participants