Skip to content

Commit 6d89447

Browse files
Apply suggestions from code review
Co-authored-by: José Valim <[email protected]>
1 parent 9442858 commit 6d89447

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

lib/elixir/lib/protocol.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ defmodule Protocol do
812812
# Without this, a protocol that defines no functions won't be detected
813813
# as a behaviour by the Erlang compiler, and any implementations of that
814814
# protocol will log a warning.
815-
@callback __impl__(:foo) :: module()
815+
@callback __impl__(:for) :: module()
816816
@callback __impl__(:target) :: module()
817817
@callback __impl__(:protocol) :: module()
818818
end

lib/elixir/test/elixir/protocol_test.exs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,11 @@ defmodule ProtocolTest do
155155
end
156156

157157
test "protocol with no functions is a behaviour" do
158-
refute capture_err(fn ->
159-
Code.eval_string("""
160-
defprotocol ProtoNoFunctions do
161-
end
162-
163-
defimpl ProtoNoFunctions, for: Integer do
164-
end
165-
""")
166-
end) =~ "module ProtoNoFunctions is not a behaviour"
158+
defprotocol ProtoNoFunctions do
159+
end
160+
161+
defimpl ProtoNoFunctions, for: Integer do
162+
end
167163
end
168164

169165
test "protocol defines functions and attributes" do

0 commit comments

Comments
 (0)