Skip to content

Commit 39160df

Browse files
author
José Valim
committed
Improve Access deprecation warning
1 parent 08d2aaa commit 39160df

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/elixir/lib/access.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ defmodule Access do
4444
nil
4545
4646
Since Access is a behaviour, it can be implemented to key-value
47-
data structures. Access requires the key comparison to be
48-
implemented using the `===` operator.
47+
data structures. The implementation should be added to the
48+
module that defines the struct being access. Access requires the
49+
key comparison to be implemented using the `===` operator.
4950
5051
## Field-based lookups
5152

lib/elixir/lib/protocol.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ defmodule Protocol do
537537
if Atom.to_string(protocol) =~ "Elixir.Access" do
538538
:elixir_errors.warn __ENV__.line, __ENV__.file,
539539
"implementation of the Access protocol is deprecated. For customization of " <>
540-
"the dict[key] syntax, please implement the Dict behaviour instead"
540+
"the data[key] syntax, please implement the Access behaviour in your struct"
541541
else
542542
Protocol.assert_protocol!(protocol)
543543
Protocol.__ensure_defimpl__(protocol, for, __ENV__)

0 commit comments

Comments
 (0)