@@ -690,151 +690,77 @@ def test_struct
690690 SignatureManager . new do |manager |
691691 manager . build do |env |
692692 p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::StructInheritWithNil" ] , env : env , merge : false )
693- if Runtime ::StructGenerator ::CAN_CALL_KEYWORD_INIT_P
694- assert_write p . decls , <<~RBS
695- module RBS
696- class RuntimePrototypeTest < ::Test::Unit::TestCase
697- class StructInheritWithNil < ::Struct[untyped]
698- def self.new: (?untyped foo, ?untyped bar, ?untyped `baz?`) -> instance
699- | (?foo: untyped, ?bar: untyped, ?baz?: untyped) -> instance
693+ assert_write p . decls , <<~RBS
694+ module RBS
695+ class RuntimePrototypeTest < ::Test::Unit::TestCase
696+ class StructInheritWithNil < ::Struct[untyped]
697+ def self.new: (?untyped foo, ?untyped bar, ?untyped `baz?`) -> instance
698+ | (?foo: untyped, ?bar: untyped, ?baz?: untyped) -> instance
700699
701- def self.[]: (?untyped foo, ?untyped bar, ?untyped `baz?`) -> instance
702- | (?foo: untyped, ?bar: untyped, ?baz?: untyped) -> instance
700+ def self.[]: (?untyped foo, ?untyped bar, ?untyped `baz?`) -> instance
701+ | (?foo: untyped, ?bar: untyped, ?baz?: untyped) -> instance
703702
704- def self.keyword_init?: () -> nil
703+ def self.keyword_init?: () -> nil
705704
706- def self.members: () -> [ :foo, :bar, :baz? ]
705+ def self.members: () -> [ :foo, :bar, :baz? ]
707706
708- def members: () -> [ :foo, :bar, :baz? ]
707+ def members: () -> [ :foo, :bar, :baz? ]
709708
710- attr_accessor foo: untyped
709+ attr_accessor foo: untyped
711710
712- attr_accessor bar: untyped
711+ attr_accessor bar: untyped
713712
714- attr_accessor baz?: untyped
715- end
713+ attr_accessor baz?: untyped
716714 end
717715 end
718- RBS
719- else
720- assert_write p . decls , <<~RBS
721- module RBS
722- class RuntimePrototypeTest < ::Test::Unit::TestCase
723- class StructInheritWithNil < ::Struct[untyped]
724- def self.new: (?untyped foo, ?untyped bar, ?untyped `baz?`) -> instance
725- | (?foo: untyped, ?bar: untyped, ?baz?: untyped) -> instance
726-
727- def self.[]: (?untyped foo, ?untyped bar, ?untyped `baz?`) -> instance
728- | (?foo: untyped, ?bar: untyped, ?baz?: untyped) -> instance
729-
730- def self.members: () -> [ :foo, :bar, :baz? ]
731-
732- def members: () -> [ :foo, :bar, :baz? ]
733-
734- attr_accessor foo: untyped
735-
736- attr_accessor bar: untyped
737-
738- attr_accessor baz?: untyped
739- end
740- end
741- end
742- RBS
743- end
716+ end
717+ RBS
744718
745719 p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::StructKeywordInitTrue" ] , env : env , merge : false )
746- if Runtime ::StructGenerator ::CAN_CALL_KEYWORD_INIT_P
747- assert_write p . decls , <<~RBS
748- module RBS
749- class RuntimePrototypeTest < ::Test::Unit::TestCase
750- class StructKeywordInitTrue < ::Struct[untyped]
751- def self.new: (?foo: untyped, ?bar: untyped) -> instance
752-
753- def self.[]: (?foo: untyped, ?bar: untyped) -> instance
754-
755- def self.keyword_init?: () -> true
756-
757- def self.members: () -> [ :foo, :bar ]
758-
759- def members: () -> [ :foo, :bar ]
760-
761- attr_accessor foo: untyped
720+ assert_write p . decls , <<~RBS
721+ module RBS
722+ class RuntimePrototypeTest < ::Test::Unit::TestCase
723+ class StructKeywordInitTrue < ::Struct[untyped]
724+ def self.new: (?foo: untyped, ?bar: untyped) -> instance
762725
763- attr_accessor bar: untyped
764- end
765- end
766- end
767- RBS
768- else
769- assert_write p . decls , <<~RBS
770- module RBS
771- class RuntimePrototypeTest < ::Test::Unit::TestCase
772- class StructKeywordInitTrue < ::Struct[untyped]
773- def self.new: (?untyped foo, ?untyped bar) -> instance
774- | (?foo: untyped, ?bar: untyped) -> instance
726+ def self.[]: (?foo: untyped, ?bar: untyped) -> instance
775727
776- def self.[]: (?untyped foo, ?untyped bar) -> instance
777- | (?foo: untyped, ?bar: untyped) -> instance
728+ def self.keyword_init?: () -> true
778729
779- def self.members: () -> [ :foo, :bar ]
730+ def self.members: () -> [ :foo, :bar ]
780731
781- def members: () -> [ :foo, :bar ]
732+ def members: () -> [ :foo, :bar ]
782733
783- attr_accessor foo: untyped
734+ attr_accessor foo: untyped
784735
785- attr_accessor bar: untyped
786- end
736+ attr_accessor bar: untyped
787737 end
788738 end
789- RBS
790- end
739+ end
740+ RBS
791741
792742 p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::StructKeywordInitFalse" ] , env : env , merge : false )
793- if Runtime ::StructGenerator ::CAN_CALL_KEYWORD_INIT_P
794- assert_write p . decls , <<~RBS
795- module RBS
796- class RuntimePrototypeTest < ::Test::Unit::TestCase
797- class StructKeywordInitFalse < ::Struct[untyped]
798- def self.new: (?untyped foo, ?untyped bar) -> instance
799-
800- def self.[]: (?untyped foo, ?untyped bar) -> instance
801-
802- def self.keyword_init?: () -> false
803-
804- def self.members: () -> [ :foo, :bar ]
805-
806- def members: () -> [ :foo, :bar ]
807-
808- attr_accessor foo: untyped
743+ assert_write p . decls , <<~RBS
744+ module RBS
745+ class RuntimePrototypeTest < ::Test::Unit::TestCase
746+ class StructKeywordInitFalse < ::Struct[untyped]
747+ def self.new: (?untyped foo, ?untyped bar) -> instance
809748
810- attr_accessor bar: untyped
811- end
812- end
813- end
814- RBS
815- else
816- assert_write p . decls , <<~RBS
817- module RBS
818- class RuntimePrototypeTest < ::Test::Unit::TestCase
819- class StructKeywordInitFalse < ::Struct[untyped]
820- def self.new: (?untyped foo, ?untyped bar) -> instance
821- | (?foo: untyped, ?bar: untyped) -> instance
749+ def self.[]: (?untyped foo, ?untyped bar) -> instance
822750
823- def self.[]: (?untyped foo, ?untyped bar) -> instance
824- | (?foo: untyped, ?bar: untyped) -> instance
751+ def self.keyword_init?: () -> false
825752
826- def self.members: () -> [ :foo, :bar ]
753+ def self.members: () -> [ :foo, :bar ]
827754
828- def members: () -> [ :foo, :bar ]
755+ def members: () -> [ :foo, :bar ]
829756
830- attr_accessor foo: untyped
757+ attr_accessor foo: untyped
831758
832- attr_accessor bar: untyped
833- end
759+ attr_accessor bar: untyped
834760 end
835761 end
836- RBS
837- end
762+ end
763+ RBS
838764
839765 p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::StructDirectInherited" ] , env : env , merge : false )
840766 assert_write p . decls , <<~RBS
0 commit comments