lib/tapioca/dsl/compiler.rb in tapioca-0.8.3 vs lib/tapioca/dsl/compiler.rb in tapioca-0.9.0
- old
+ new
@@ -1,21 +1,16 @@
# typed: strict
# frozen_string_literal: true
-require "rbi"
-require "tapioca/rbi_ext/model"
-require "tapioca/rbi_formatter"
-require "tapioca/dsl/helpers/param_helper"
-require "tapioca/dsl/pipeline"
-
module Tapioca
module Dsl
class Compiler
extend T::Sig
extend T::Helpers
extend T::Generic
+ include RBIHelper
include Runtime::Reflection
extend Runtime::Reflection
ConstantType = type_member { { upper: Module } }
@@ -117,12 +112,10 @@
return_type: compile_method_return_type_to_rbi(method_def),
class_method: class_method
)
end
- include Helpers::ParamHelper
-
sig { params(method_def: T.any(Method, UnboundMethod)).returns(T::Array[RBI::TypedParam]) }
def compile_method_parameters_to_rbi(method_def)
signature = signature_of(method_def)
method_def = signature.nil? ? method_def : signature.method
method_types = parameters_types_from_signature(method_def, signature)
@@ -172,14 +165,9 @@
if type.start_with?("T.nilable(", "::T.nilable(") || type == "T.untyped" || type == "::T.untyped"
type
else
"T.nilable(#{type})"
end
- end
-
- sig { params(name: String).returns(T::Boolean) }
- def valid_parameter_name?(name)
- name.match?(/^[[[:alnum:]]_]+$/)
end
end
end
end