Skip to content

Access syntax should raise when used on lists and key is not an atom #4071

@ericmj

Description

@ericmj
list = [{0, "a"}]
list[0] # <= this does not raise
Keyword.get(list, 0) # <= this raises correctly

We can't check if the full list is correct because we use :lists.keyfind/3 for performance reasons, but we should at least check that the given key is an atom.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions