From 1d7c124adb1f1b0b757221606f9bb127f2e3ac2d Mon Sep 17 00:00:00 2001 From: Angelika Tyborska Date: Sun, 24 Dec 2023 09:12:14 +0100 Subject: [PATCH] Allow argument name is two-fer @spec --- elixir | 2 +- lib/elixir_analyzer/test_suite/two_fer.ex | 6 +++++- test/elixir_analyzer/test_suite/two_fer_test.exs | 14 ++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/elixir b/elixir index c9c364ad..63e38a1a 160000 --- a/elixir +++ b/elixir @@ -1 +1 @@ -Subproject commit c9c364adfaeb6a0b885fd14f39e49c4a7ac308cd +Subproject commit 63e38a1ab90594a9e0eda48a558a81e7f0c3d1c3 diff --git a/lib/elixir_analyzer/test_suite/two_fer.ex b/lib/elixir_analyzer/test_suite/two_fer.ex index c9584cc1..3ce8d935 100644 --- a/lib/elixir_analyzer/test_suite/two_fer.ex +++ b/lib/elixir_analyzer/test_suite/two_fer.ex @@ -24,7 +24,7 @@ defmodule ElixirAnalyzer.TestSuite.TwoFer do end feature "has wrong spec" do - find :all + find :any type :actionable suppress_if "has spec", :fail comment Constants.two_fer_wrong_specification() @@ -32,6 +32,10 @@ defmodule ElixirAnalyzer.TestSuite.TwoFer do form do @spec two_fer(String.t()) :: String.t() end + + form do + @spec two_fer(_ignore :: String.t()) :: String.t() + end end feature "has default parameter" do diff --git a/test/elixir_analyzer/test_suite/two_fer_test.exs b/test/elixir_analyzer/test_suite/two_fer_test.exs index 56267922..3cfc41be 100644 --- a/test/elixir_analyzer/test_suite/two_fer_test.exs +++ b/test/elixir_analyzer/test_suite/two_fer_test.exs @@ -31,10 +31,16 @@ defmodule ElixirAnalyzer.TestSuite.TwoFerTest do Constants.solution_use_specification(), Constants.two_fer_wrong_specification() ] do - defmodule TwoFer do - @spec two_fer(String.t()) :: String.t() - def two_fer(name) - end + [ + defmodule TwoFer do + @spec two_fer(String.t()) :: String.t() + def two_fer(name) + end, + defmodule TwoFer do + @spec two_fer(name :: String.t()) :: String.t() + def two_fer(name) + end + ] end test_exercise_analysis "refer when wrong spec",