Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hovering on method called on union type shows effective type of method twice #4150

Open
jez opened this issue Apr 16, 2021 · 0 comments
Open
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers IDE Relating to Sorbet's LSP server or VS Code extension

Comments

@jez
Copy link
Collaborator

jez commented Apr 16, 2021

Input

→ View on sorbet.run

# typed: true
extend T::Sig

class A
  extend T::Sig

  # Docs for A#foo
  sig {returns(String)}
  def foo; ''; end
end

class B
  extend T::Sig

  # Docs for B#foo
  sig {returns(Integer)}
  def foo; 0; end
end

sig {params(x: T.any(A, B)).void}
def example(x)
  x.foo
  # ^ hover here
  # it shows the method def twice
end

Observed output

No errors! Great job.

Screen Shot 2021-04-15 at 6 02 03 PM

Expected behavior

It should either:

  • show two defs, one for each method, or ideally:
  • one def with the effective type.

@jez jez added bug Something isn't working good first issue Good for newcomers IDE Relating to Sorbet's LSP server or VS Code extension labels Apr 16, 2021
@jez jez added enhancement New feature or surprising current feature and removed bug Something isn't working labels Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or surprising current feature good first issue Good for newcomers IDE Relating to Sorbet's LSP server or VS Code extension
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant