Skip to content

Commit 7b80ac9

Browse files
committed
Fix failures
1 parent 075222d commit 7b80ac9

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

lib/elixir/lib/protocol.ex

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,17 @@ defmodule Protocol do
631631
{[Module.Types.Of.impl(impl)], Descr.atom([Module.concat(protocol, impl)])}
632632
end)
633633

634+
# TODO: Test a protocol with no implementation
634635
domain =
635-
clauses
636-
|> Enum.map(fn {[domain], _} -> domain end)
637-
|> Enum.reduce(&Descr.union/2)
636+
case clauses do
637+
[] ->
638+
Descr.none()
639+
640+
_ ->
641+
clauses
642+
|> Enum.map(fn {[domain], _} -> domain end)
643+
|> Enum.reduce(&Descr.union/2)
644+
end
638645

639646
not_domain = Descr.negation(domain)
640647

lib/ex_unit/test/ex_unit/formatter_test.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ defmodule ExUnit.FormatterTest do
507507
defstruct key: 0
508508

509509
defimpl Inspect do
510-
def inspect(struct, opts) when is_atom(opts) do
511-
struct.unknown
510+
def inspect(_struct, opts) when is_atom(opts) do
511+
raise "the clause above should never match"
512512
end
513513
end
514514
end

0 commit comments

Comments
 (0)