Skip to content

Confusing error: "undefined function" when actually private #4405

@nathanl

Description

@nathanl

Environment

  • Elixir version (elixir -v): 1.3.0-dev
  • Operating system: OS X 10.11

Current behavior

apply(__MODULE__, :name_of_private_function, [some,args] gives error "undefined function"

Expected behavior

I was confused by this. I figured out that apply is inlined to __MODULE__.name_of_function..., but it took a minute to understand that the function definition I was looking at wasn't being found because it was private.

I think that something like "undefined (or private) function Foo.bar/2" would be a clearer error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions