module RBS class DefinitionBuilder attr_reader env: Environment attr_reader type_name_resolver: TypeNameResolver attr_reader ancestor_builder: AncestorBuilder attr_reader method_builder: MethodBuilder attr_reader instance_cache: Hash[[TypeName, bool], Definition | false | nil] attr_reader singleton_cache: Hash[TypeName, Definition | false | nil] attr_reader singleton0_cache: Hash[TypeName, Definition | false | nil] attr_reader interface_cache: Hash[TypeName, Definition | false | nil] def initialize: (env: Environment, ?ancestor_builder: AncestorBuilder?, ?method_builder: MethodBuilder?) -> void def validate_super_class!: (TypeName, Environment::ClassEntry) -> void def ensure_namespace!: (Namespace, location: Location[untyped, untyped]?) -> void def build_interface: (TypeName) -> Definition def build_instance: (TypeName, ?no_self_types: bool) -> Definition def build_singleton0: (TypeName) -> Definition def build_singleton: (TypeName) -> Definition def merge_definition: (src: Definition, dest: Definition, subst: Substitution, ?implemented_in: :keep | TypeName | nil, ?keep_super: bool) -> void def merge_method: (TypeName, Hash[Symbol, Definition::Method], Symbol, Definition::Method, Substitution, ?implemented_in: :keep | TypeName | nil, ?keep_super: bool) -> void def merge_variable: (Hash[Symbol, Definition::Variable], Symbol, Definition::Variable, Substitution, ?keep_super: bool) -> void def try_cache: (TypeName, cache: Hash[TypeName, Definition | false | nil]) { () -> Definition } -> Definition | [A] (TypeName, cache: Hash[A, Definition | false | nil], key: A) { () -> Definition } -> Definition def validate_params_with: (AST::Declarations::ModuleTypeParams, result: VarianceCalculator::Result) { (AST::Declarations::ModuleTypeParams::TypeParam) -> void } -> void def validate_type_params: (Definition, ancestors: AncestorBuilder::OneAncestors, methods: MethodBuilder::Methods) -> void def source_location: (Definition::Ancestor::Instance::source, AST::Declarations::t) -> Location[untyped, untyped]? def insert_variable: (TypeName, Hash[Symbol, Definition::Variable], name: Symbol, type: Types::t) -> void def define_methods: (Definition, interface_methods: Hash[Symbol, Definition::Method], methods: MethodBuilder::Methods, super_interface_method: bool) -> void # Validates presence of type names recursively. # Assumes the type names are already resolved. # def validate_type_presence: (Types::t) -> void def validate_type_name: (TypeName, Location[untyped, untyped]?) -> void # Expand a type alias of given name without type arguments. # Raises an error if the type alias requires arguments. # # Assume `type foo[T] = [T, T]`: # # ``` # expand_alias("::foo") # => error # ``` # def expand_alias: (TypeName) -> Types::t # Expand a type alias of given name with arguments of `untyped`. # # Assume `type foo[T] = [T, T]`: # # ``` # expand_alias1("::foo") # => [untyped, untyped] # ``` # def expand_alias1: (TypeName) -> Types::t # Expand a type alias of given name with `args`. # # Assume `type foo[T] = [T, T]`: # # ``` # expand_alias2("::foo", ["::Integer"]) # => [::Integer, ::Integer] # ``` # def expand_alias2: (TypeName, Array[Types::t] args) -> Types::t def update: (env: Environment, ancestor_builder: AncestorBuilder, except: _Each[TypeName]) -> DefinitionBuilder end end