exercism / elixir-analyzer

GNU Affero General Public License v3.0
30 stars 32 forks source link

False positive in basics #267

Closed SleeplessByte closed 2 years ago

SleeplessByte commented 2 years ago

image

I probably should have used different syntax (without the Lasagna. prefix?), but I am pretty sure I used the function.

angelikatyborska commented 2 years ago

Damn 😞

(without the Lasagna. prefix?)

Yes.

There are other affected exercises: guessing game, chessboard, high school sweetheart... Basically anything that callsassert_call with a local function name without a module name specified in called_fn. Specifying the module name in called_fn will make it work (not return comments) for local function calls with and without a module name, which would be a quick fix. But a better, longer fix, would be to mention that you don't need the module name when referring to the function in those cases.

jiegillet commented 2 years ago

I can’t believe this never came up before :)

I would propose

  1. Making assert_call accept the module prefix even if none is specified
  2. Adding a common check: you don’t need to use the module prefix in the module itself.

Shouldn’t be too hard…

SleeplessByte commented 2 years ago

FYI the reason I prefixed it with the module name is because in the introduction and instructions, all calls are prefixed. It worked, so I thought I did the right thing 😄