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
editor.rb:9: Expected T.attached_class (of A) but found A for method result type https://srb.help/7005
9 | A.new
^^^^^
Expected T.attached_class (of A) for result type of method make:
editor.rb:8:
8 | def self.make
^^^^^^^^^^^^^
Got A originating from:
editor.rb:9:
9 | A.new
^^^^^
Note:
A is incompatible with T.attached_class (of A) because when this method is called on a subclass T.attached_class (of A) will represent a more specific subclass, meaning A will not be specific enough. See https://sorbet.org/docs/attached-class for more.
editor.rb:18: Expected T::Array[T.attached_class (of B)] but found B for method result type https://srb.help/7005
18 | B.new
^^^^^
Expected T::Array[T.attached_class (of B)] for result type of method make:
editor.rb:17:
17 | def self.make
^^^^^^^^^^^^^
Got B originating from:
editor.rb:18:
18 | B.new
^^^^^
Errors: 2
Expected behavior
The note about attached class for A should also appear for B.
It would also be nice to recommend to the user that they can replace A.new with self.new if we can detect that.
The text was updated successfully, but these errors were encountered:
Input
→ View on sorbet.run
Observed output
Expected behavior
The note about attached class for
A
should also appear forB
.It would also be nice to recommend to the user that they can replace
A.new
withself.new
if we can detect that.The text was updated successfully, but these errors were encountered: