Skip to content

Commit f4c2b7e

Browse files
committed
Type check
1 parent eae4ebb commit f4c2b7e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/rbs/prototype/rb.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ def range_element_type(types)
694694

695695
types = types.map do |t|
696696
if t.is_a?(Types::Literal)
697-
type_name = TypeName.new(name: t.literal.class.name.to_sym, namespace: Namespace.root)
697+
type_name = TypeName.new(name: t.literal.class.name&.to_sym || raise, namespace: Namespace.root)
698698
Types::ClassInstance.new(name: type_name, args: [], location: nil)
699699
else
700700
t
@@ -825,7 +825,7 @@ def sort_members!(decls)
825825
AST::Members::ClassVariable => -3,
826826
AST::Members::ClassInstanceVariable => -2,
827827
AST::Members::InstanceVariable => -1,
828-
}
828+
} #: Hash[Class, Integer]
829829
decls.sort_by! { |decl| [orders.fetch(decl.class, 0), i += 1] }
830830
end
831831
end

0 commit comments

Comments
 (0)