File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments