Skip to content

Confusing error when calling the wrong preload method #613

@jwoertink

Description

@jwoertink

I'm getting this error, but haven't figured out why yet.

A User has_one stream_approval : StreamApproval

web          |
web          |  141 | UserSerializer.new(UserQuery.new.preload_stream_approval(current_user))
web          |                                         ^----------------------
web          | Error: no overload matches 'UserQuery#preload_stream_approval' with type User
web          |
web          | Overloads are:
web          |  - User::BaseQuery#preload_stream_approval(preload_query : StreamApproval::BaseQuery)
web          |  - User::BaseQuery#preload_stream_approval()
web          |
web          | ---

The strange thing is that it only shows these two overloads, but there's 8 different versions of this method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions