You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# typed: trueclassHashextendT::Sigsig{returns(T.self_type)}defcompact_blankreject{ |_k,v| v}# would be v.blank?endend
Observed output
editor.rb:7: Expected T::Hash[Hash::K, Hash::V] but found T::Hash[Hash::K, Hash::V] for method result type https://srb.help/7005
7 | reject { |_k, v| v } # would be v.blank?
^^^^^^^^^^^^^^^^^^^^
Expected T::Hash[Hash::K, Hash::V] for result type of method compact_blank:
editor.rb:6:
6 | def compact_blank
^^^^^^^^^^^^^^^^^
Got T::Hash[Hash::K, Hash::V] originating from:
editor.rb:7:
7 | reject { |_k, v| v } # would be v.blank?
^^^^^^^^^^^^^^^^^^^^
Errors: 1
Expected behavior
Error message should not be of the form "Expected X but found X for method result type"
(I can get around it in this example with a return type of T::Hash[K, V], but that has issues in the production code, and I'd prefer to be able to use T.self_type here.)
The text was updated successfully, but these errors were encountered:
Input
→ View on sorbet.run
Observed output
Expected behavior
Error message should not be of the form "Expected
X
but foundX
for method result type"(I can get around it in this example with a return type of
T::Hash[K, V]
, but that has issues in the production code, and I'd prefer to be able to useT.self_type
here.)The text was updated successfully, but these errors were encountered: