lib/tapioca/compilers/symbol_table/symbol_generator.rb in tapioca-0.4.13 vs lib/tapioca/compilers/symbol_table/symbol_generator.rb in tapioca-0.4.14

- old
+ new

@@ -190,28 +190,25 @@ sig { params(constant: Module).returns(String) } def compile_module_helpers(constant) abstract_type = T::Private::Abstract::Data.get(constant, :abstract_type) - if abstract_type - indented("#{abstract_type}!") - elsif T::Private::Final.final_module?(constant) - indented("final!") - elsif T::Private::Sealed.sealed_module?(constant) - indented("sealed!") - else - "" - end + helpers = [] + helpers << indented("#{abstract_type}!") if abstract_type + helpers << indented("final!") if T::Private::Final.final_module?(constant) + helpers << indented("sealed!") if T::Private::Sealed.sealed_module?(constant) + + helpers.join("\n") end sig { params(constant: Module).returns(String) } def compile_props(constant) return "" unless T::Props::ClassMethods === constant constant.props.map do |name, prop| method = "prop" method = "const" if prop.fetch(:immutable, false) - type = prop.fetch(:type_object, "T.untyped") + type = prop.fetch(:type_object, "T.untyped").to_s.gsub(".returns(<VOID>)", ".void") if prop.key?(:default) indented("#{method} :#{name}, #{type}, default: T.unsafe(nil)") else indented("#{method} :#{name}, #{type}")