@@ -775,74 +775,72 @@ class StructDirectInherited < ::Struct[untyped]
775775 end
776776 end
777777
778- if RUBY_VERSION >= '3.2'
779- class DataInherit < Data . define ( :foo , :bar , :baz? )
780- end
781- DataConst = Data . define ( :foo , :bar )
782- class DataDirectInherit < Data
783- end
778+ class DataInherit < Data . define ( :foo , :bar , :baz? )
779+ end
780+ DataConst = Data . define ( :foo , :bar )
781+ class DataDirectInherit < Data
782+ end
784783
785- def test_data
786- SignatureManager . new do |manager |
787- manager . build do |env |
788- p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::DataInherit" ] , env : env , merge : false )
789- assert_write p . decls , <<~RBS
790- module RBS
791- class RuntimePrototypeTest < ::Test::Unit::TestCase
792- class DataInherit < ::Data
793- def self.new: (untyped foo, untyped bar, untyped `baz?`) -> instance
794- | (foo: untyped, bar: untyped, baz?: untyped) -> instance
784+ def test_data
785+ SignatureManager . new do |manager |
786+ manager . build do |env |
787+ p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::DataInherit" ] , env : env , merge : false )
788+ assert_write p . decls , <<~RBS
789+ module RBS
790+ class RuntimePrototypeTest < ::Test::Unit::TestCase
791+ class DataInherit < ::Data
792+ def self.new: (untyped foo, untyped bar, untyped `baz?`) -> instance
793+ | (foo: untyped, bar: untyped, baz?: untyped) -> instance
795794
796- def self.[]: (untyped foo, untyped bar, untyped `baz?`) -> instance
797- | (foo: untyped, bar: untyped, baz?: untyped) -> instance
795+ def self.[]: (untyped foo, untyped bar, untyped `baz?`) -> instance
796+ | (foo: untyped, bar: untyped, baz?: untyped) -> instance
798797
799- def self.members: () -> [ :foo, :bar, :baz? ]
798+ def self.members: () -> [ :foo, :bar, :baz? ]
800799
801- def members: () -> [ :foo, :bar, :baz? ]
800+ def members: () -> [ :foo, :bar, :baz? ]
802801
803- attr_reader foo: untyped
802+ attr_reader foo: untyped
804803
805- attr_reader bar: untyped
804+ attr_reader bar: untyped
806805
807- attr_reader baz?: untyped
808- end
806+ attr_reader baz?: untyped
809807 end
810808 end
811- RBS
809+ end
810+ RBS
812811
813- p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::DataConst" ] , env : env , merge : false )
814- assert_write p . decls , <<~RBS
815- module RBS
816- class RuntimePrototypeTest < ::Test::Unit::TestCase
817- class DataConst < ::Data
818- def self.new: (untyped foo, untyped bar) -> instance
819- | (foo: untyped, bar: untyped) -> instance
812+ p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::DataConst" ] , env : env , merge : false )
813+ assert_write p . decls , <<~RBS
814+ module RBS
815+ class RuntimePrototypeTest < ::Test::Unit::TestCase
816+ class DataConst < ::Data
817+ def self.new: (untyped foo, untyped bar) -> instance
818+ | (foo: untyped, bar: untyped) -> instance
820819
821- def self.[]: (untyped foo, untyped bar) -> instance
822- | (foo: untyped, bar: untyped) -> instance
820+ def self.[]: (untyped foo, untyped bar) -> instance
821+ | (foo: untyped, bar: untyped) -> instance
823822
824- def self.members: () -> [ :foo, :bar ]
823+ def self.members: () -> [ :foo, :bar ]
825824
826- def members: () -> [ :foo, :bar ]
825+ def members: () -> [ :foo, :bar ]
827826
828- attr_reader foo: untyped
827+ attr_reader foo: untyped
829828
830- attr_reader bar: untyped
831- end
829+ attr_reader bar: untyped
832830 end
833831 end
834- RBS
832+ end
833+ RBS
835834
836- p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::DataDirectInherit" ] , env : env , merge : false )
837- assert_write p . decls , <<~RBS
838- module RBS
839- class RuntimePrototypeTest < ::Test::Unit::TestCase
840- class DataDirectInherit < ::Data
841- end
835+ p = Runtime . new ( patterns : [ "RBS::RuntimePrototypeTest::DataDirectInherit" ] , env : env , merge : false )
836+ assert_write p . decls , <<~RBS
837+ module RBS
838+ class RuntimePrototypeTest < ::Test::Unit::TestCase
839+ class DataDirectInherit < ::Data
842840 end
843841 end
844- RBS
845- end
842+ end
843+ RBS
846844 end
847845 end
848846 end
0 commit comments