title: How would you do rose memoization with Sorbet?
body: <p>Trying to annotate this code, the rose memoization (<code>@||=</code>) gives me an error <code>Use of undeclared variable @git_sha</code>.</p>
  
  <pre class="lang-rb prettyprint-override"><code># typed: strict
  # frozen_string_literal: true
  
  module Util
    extend T::Sig
  
    sig { returns(String) }
    def self.git_sha
      @git_sha ||= ENV.fetch(
        'GIT_REV',
        `git rev-parse --verify HEAD 2&gt;&amp;1`
      ).chomp
    end
  end
  </code></pre>
  
  <p>As far as I've found, I should declare the variable's type with <code>T.let</code> but haven't figured out specifically how.</p>