class RBS::Definition::InstanceAncestors
Attributes
ancestors
[R]
Array[Ancestor::t]
Public Class Methods
Public Instance Methods
(Array[Types::t], env: Environment, location: Location[untyped, untyped]?) → Array[Ancestor::t]
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/definition.rb, line 260 def apply(args, env:, location:) InvalidTypeApplicationError.check2!(env: env, type_name: type_name, args: args, location: location) subst = Substitution.build(params, args) ancestors.map do |ancestor| case ancestor when Ancestor::Instance if ancestor.args.empty? ancestor else Ancestor::Instance.new( name: ancestor.name, args: ancestor.args.map {|type| type.sub(subst) }, source: ancestor.source ) end when Ancestor::Singleton ancestor end end end