Skip to content

Commit 8def030

Browse files
committed
Use type warning instead of typing violation, closes #15065
1 parent 61d82a9 commit 8def030

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ The code above has a type violation, which is now caught by the type system:
146146
147147
dynamic(%{..., name: term()})
148148
149-
typing violation found at:
149+
type warning found at:
150150
151151
16 │ User.name(%{})
152152
│ ~

lib/elixir/lib/module/types/apply.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ defmodule Module.Types.Apply do
17431743
but the #{inspect(mod)} protocol was not yet implemented \
17441744
for any type and therefore will always fail.
17451745
1746-
This warning will disappear once you define a implementation. \
1746+
This message will disappear once you define a implementation. \
17471747
If the protocol is part of a library, you may define a dummy \
17481748
implementation for development/test.
17491749
""", ""}

lib/elixir/src/elixir_errors.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ format_snippet(Severity, Position, File, Message, Snippet, Diagnostic) ->
184184

185185
unicode:characters_to_binary(Formatted).
186186

187-
format_detail(#{details := #{typing_traces := _}}, Message) -> [Message | "\ntyping violation found at:"];
187+
format_detail(#{details := #{typing_traces := _}}, Message) -> [Message | "\ntype warning found at:"];
188188
format_detail(_, Message) -> Message.
189189

190190
calculate_span_length({StartLine, StartCol}, #{span := {StartLine, EndCol}}) -> EndCol - StartCol;

lib/elixir/test/elixir/module/types/integration_test.exs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ defmodule Module.Types.IntegrationTest do
335335
""",
336336
"the 1st argument is empty (often represented as none())",
337337
"""
338-
typing violation found at:
338+
type warning found at:
339339
340340
2 │ def error(), do: private(raise "oops")
341341
│ ~
@@ -348,7 +348,7 @@ defmodule Module.Types.IntegrationTest do
348348
private(List.to_tuple(x))
349349
""",
350350
"""
351-
typing violation found at:
351+
type warning found at:
352352
353353
3 │ def public(x), do: private(List.to_tuple(x))
354354
│ ~
@@ -489,7 +489,7 @@ defmodule Module.Types.IntegrationTest do
489489
490490
hint: defimpl for Range requires its callbacks to match exclusively on %Range{}
491491
492-
typing violation found at:
492+
type warning found at:
493493
494494
6 │ def itself(nil), do: nil
495495
│ ~~~~~~~~~~~~~~~~~~~~~~~~
@@ -530,9 +530,9 @@ defmodule Module.Types.IntegrationTest do
530530
531531
but the NoImplProtocol protocol was not yet implemented for any type and therefore will always fail.
532532
533-
This warning will disappear once you define a implementation. If the protocol is part of a library, you may define a dummy implementation for development/test.
533+
This message will disappear once you define a implementation. If the protocol is part of a library, you may define a dummy implementation for development/test.
534534
535-
typing violation found at:
535+
type warning found at:
536536
537537
3 │ NoImplProtocol.callback(:hello)
538538
│ ~
@@ -714,7 +714,7 @@ defmodule Module.Types.IntegrationTest do
714714
715715
:ok
716716
717-
typing violation found at:
717+
type warning found at:
718718
719719
2 │ def ok(x = :ok \\ nil) do
720720
│ ~

0 commit comments

Comments
 (0)