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

sorbet-unwrap: debugging inside T.let / T.cast still a problem #5

Open
md-work opened this issue Jul 13, 2020 · 0 comments
Open

sorbet-unwrap: debugging inside T.let / T.cast still a problem #5

md-work opened this issue Jul 13, 2020 · 0 comments

Comments

@md-work
Copy link
Contributor

md-work commented Jul 13, 2020

Sadly sorbet-unwrap won't help if there's a method call inside T.let(..., or T.cast(..., .

 

Proposal: sorbet-unwrap could overwrite T.let / T.cast with a minimal implementation, which simply forwards the first argument and ignores the second.

module T
  def self.let(value, type, checked: true)
    value
  end
  
  def self.cast(value, type, checked: true)
    value
  end
end

 

Sadly I've no idea how the evaluation of the second parameter may be skipped. This would be a problem, if the second parameter is something like T::Array[Integer] because there will be code to step trough.

See also: sorbet/sorbet#3279

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant