Module

Protocol

Changes by version

Elixir 1.19.5

· 2 changes

Enhancement Tool: Elixir

Optimize protocol consolidation to no longer load structs

Bugfix Tool: Elixir

Ensure protocol consolidation no longer stores outdated struct types. As a consequence, protocols types only track struct names at the moment

Elixir 1.19.1

· 1 change

Bugfix Tool: Elixir

Improve protocol violation warnings

Elixir 1.19.0

· 2 changes

Enhancement Tool: Elixir

Type checking of protocols dispatch and implementations

Bugfix Tool: Elixir

defstruct/1 and defexception/1 are now disabled inside defprotocol as to not allow defining structs/exceptions alongside a protocol

Elixir 1.18.3

· 1 change

Bugfix Tool: Elixir

Return correct implementation for an invalid struct pointing to nil

Elixir 1.18.0

· 3 changes

Enhancement Tool: Elixir

Add @undefined_impl_description to customize error message when an implementation is undefined

Enhancement Tool: Elixir

Add __deriving__/1 as optional macro callback to Protocol, no longer requiring empty implementations

Enhancement Tool: Elixir

Defining __deriving__/3 inside the Any implementation is deprecated, derive it inside the protocol definition itself

Elixir 1.14.2

· 1 change

Bugfix Tool: Elixir

Expand :for in protocols with the appropriate env

Elixir 1.14.0

· 1 change

Bugfix Tool: Elixir

Warn if a protocol has no definitions

Elixir 1.13.2

· 1 change

Bugfix Tool: Elixir

Warn on zero arity callbacks inside protocols

Elixir 1.13.0

· 3 changes

Bugfix Tool: Elixir

Add defdelegate to the list of unallowed macros inside protocols as protocols do not allow function definitions

Bugfix Tool: Elixir

Warn if @callback, @macrocallback and @optional_callbacks are defined inside protocol

Bugfix Tool: Elixir

Ensure protocol metadata is deterministic on consolidation

Elixir 1.9.0

· 3 changes

Enhancement Tool: Elixir

Improve Protocol.UndefinedError messages to also include the type that was attempted to dispatch on

Enhancement Tool: Elixir

Optimize performance of dynamic dispatching for non-consolidated protocols

Bugfix Tool: Elixir

Ensure debug_info is kept in protocols

Elixir 1.8.2

· 1 change

Bugfix Tool: Elixir

Ensure :debug_info is kept in protocols

Elixir 1.6.1

· 1 change

Bugfix Tool: Elixir

Fix protocol consolidation when some chunks may be missing

Elixir 1.5.0

· 2 changes

Enhancement Tool: Elixir

Show available implementations on Protocol.UndefinedError if the protocol has been consolidated

Bugfix Tool: Elixir

Do not lose source compile info on protocol consolidation

Elixir 1.3.4

· 1 change

Bugfix Tool: Elixir

Do not emit warnings when using protocols on opaque types

Elixir 1.2.1

· 1 change

Enhancement Tool: Elixir

Warn when defimpl is called for a consolidated protocol

Elixir 1.1.0

· 1 change

Bugfix Tool: Elixir

Guarantee that derived protocols go through Any instead of Map

Elixir 0.15.0

· 1 change

Enhancement Tool: Elixir

Do not expose protocol convention on assert_impl!/2

Elixir 0.14.0

· 2 changes

Enhancement Tool: Elixir

Add Protocol.consolidate/2, Protocol.consolidated?/1 and a mix compile.protocols task for protocol consolidation

Enhancement Tool: Elixir

Add Protocol.derive/3 for runtime deriving of a struct

Elixir 0.11.0

· 4 changes

Enhancement Tool: Elixir

Protocols now provide impl_for/1 and impl_for!/1 functions which receive a structure and returns its respective implementation, otherwise returns nil or an error

Enhancement Tool: Elixir

@only and @except in protocols are now deprecated

Enhancement Tool: Elixir

Protocols no longer fallback to Any out of the box (this functionality needs to be explicitly enabled by setting @fallback_to_any to true)

Enhancement Tool: Elixir

Protocol no longer dispatches to Number, but to Integer and Float