Typecheck fails on file included by gem as part of a generator and can't seem to override / overload it.
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!
What version of Solargraph are you using? I haven't been able to reproduce this error with 0.44.3.
The test repo is on 0.44.3 and still reproduces this error.