File tree 3 files changed +25
-2
lines changed
3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -334,7 +334,7 @@ defmodule Module.ParallelChecker do
334
334
335
335
defp position_to_tuple ( position ) do
336
336
case position [ :column ] do
337
- nil -> position [ :line ]
337
+ nil -> position [ :line ] || 0
338
338
col -> { position [ :line ] , col }
339
339
end
340
340
end
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ defmodule Kernel.DiagnosticsTest do
153
153
"""
154
154
end
155
155
156
- test "trim inbetween lines if too many" do
156
+ test "trim in between lines if too many" do
157
157
output =
158
158
capture_raise (
159
159
"""
Original file line number Diff line number Diff line change @@ -695,6 +695,29 @@ defmodule Module.Types.IntegrationTest do
695
695
696
696
assert_warnings ( files , warnings )
697
697
end
698
+
699
+ test "reports unquote functions" do
700
+ files = % {
701
+ "a.ex" => """
702
+ defmodule A do
703
+ @deprecated "oops"
704
+ def a, do: :ok
705
+ end
706
+ """ ,
707
+ "b.ex" => """
708
+ defmodule B do
709
+ def b, do: unquote(&A.a/0)
710
+ end
711
+ """
712
+ }
713
+
714
+ warnings = [
715
+ "A.a/0 is deprecated. oops" ,
716
+ "b.ex: B.b/0"
717
+ ]
718
+
719
+ assert_warnings ( files , warnings )
720
+ end
698
721
end
699
722
700
723
defp assert_warnings ( files , expected ) when is_binary ( expected ) do
You can’t perform that action at this time.
0 commit comments