Skip to content

Commit d1a833a

Browse files
committed
fixup! Rewrite type aliases
1 parent 7cb65ab commit d1a833a

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

test/spoom/sorbet/translate/rbs_comments_to_sorbet_sigs_test.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,32 @@ def ensure_string(text)
560560
RB
561561
end
562562

563+
def test_translate_broken_type_alias_continuation
564+
contents = <<~RB
565+
#: type multiLine =
566+
#| String
567+
#| | Integer
568+
# foo bar baz
569+
#| | Symbol
570+
571+
#: () -> multiLine
572+
def foo
573+
""
574+
end
575+
RB
576+
577+
assert_equal(<<~RB, rbs_comments_to_sorbet_sigs(contents))
578+
MultiLine = T.type_alias { T.any(String, Integer) }
579+
# foo bar baz
580+
#| | Symbol
581+
582+
sig { returns(MultiLine) }
583+
def foo
584+
""
585+
end
586+
RB
587+
end
588+
563589
private
564590

565591
#: (String, ?max_line_length: Integer?) -> String

0 commit comments

Comments
 (0)