Skip to content

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

Open
@md-work

Description

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

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