castwide / solargraph

A Ruby language server.
https://solargraph.org
MIT License
1.87k stars 154 forks source link

[Bug]nest block in instance_exec infer to wrong self type #619

Open SolaWing opened 1 year ago

SolaWing commented 1 year ago
[].instance_exec do
  self.reverse # => Array
  self.each do |v|
    self # => infer to wrong Class<>
  end
end
castwide commented 1 year ago

Confirmed. It looks like the initial mapping infers the nested self correctly, but subsequent updates are incorrect. I'll look into it.