sig/validator.rbs in rbs-3.0.0.dev.1 vs sig/validator.rbs in rbs-3.0.0.dev.2

- old
+ new

@@ -1,33 +1,33 @@ module RBS class Validator attr_reader env: Environment - attr_reader resolver: TypeNameResolver + attr_reader resolver: Resolver::TypeNameResolver attr_reader definition_builder: DefinitionBuilder attr_reader type_alias_dependency: TypeAliasDependency attr_reader type_alias_regularity: TypeAliasRegularity - def initialize: (env: Environment, resolver: TypeNameResolver) -> void + def initialize: (env: Environment, resolver: Resolver::TypeNameResolver) -> void # Validates the presence of type names and type application arity match. # - def validate_type: (Types::t, context: TypeNameResolver::context) -> void + def validate_type: (Types::t, context: Resolver::context) -> void # Validates type alias definition: # # - There is no circular definition between aliases # - The type alias is _regular_ # - The generics type parameter variance annotation is consistent with respect to their usage # - There is no circular dependencies between the generics type parameter bounds # # It yields the rhs type if block is given, so that you can validate the rhs type. # - def validate_type_alias: (entry: Environment::SingleEntry[TypeName, AST::Declarations::Alias]) ?{ (Types::t rhs_type) -> void } -> void + def validate_type_alias: (entry: Environment::TypeAliasEntry) ?{ (Types::t rhs_type) -> void } -> void # Validates the type parameters in generic methods. # def validate_method_definition: (AST::Members::MethodDefinition, type_name: TypeName) -> void @@ -40,13 +40,20 @@ # [X < _Foo[Y], Y < _Foo[X]] # Error # ``` # def validate_type_params: (Array[AST::TypeParam] params, type_name: TypeName, ?method_name: Symbol?, location: Location[untyped, untyped]?) -> void + # Validates class alias declaration + # + # - The right hand side can be normalized + # - No mixing alias declaration between class and modules + # + def validate_class_alias: (entry: Environment::ClassAliasEntry | Environment::ModuleAliasEntry) -> void + private # Resolves relative type names to absolute type names in given context. # Yields the type when the type name resolution using `#resolver` fails. # - def absolute_type: (Types::t, context: TypeNameResolver::context) { (Types::t) -> TypeName } -> Types::t + def absolute_type: (Types::t, context: Resolver::context) { (Types::t) -> TypeName } -> Types::t end end