Skip to content

Typecheck fails on file included by gem as part of a generator and can't seem to override / overload it.  #538

@swalke16

Description

@swalke16

I made a test repository for reproduction. It's just a Rails.new with about three files added and one additional gem included.

If you run solargraph typecheck in this project you should get:

/solar-test/app/models/concerns/admin_permissions.rb:3 - Not enough arguments to ApplicationPolicy.new
This seems to be happening because the pundit gem includes a template file for application_policy.rb used as part of a generator that has an initializer with definition of:

def initialize(user, record); end
Our project overrides / overloads this in app/policies/application_policy.rb with a new initializer defined as:

def initialize(user, record = nil); end
No matter what I attempt to put in my config/solargraph_definitions.rb for overload / override I can't seem to eliminate that typecheck error.

Thanks in advance for any suggestions!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions