class RBS::AST::Ruby::Annotations::TypeApplicationAnnotation
[T1, T2, ...] annotation in trailing comments
#[String, Integer]
^ -- prefix_location
^ -- comma_locations[0]
^ -- close_bracket_location
Attributes
close_bracket_location
[R]
Location
comma_locations
[R]
Array[Location]
type_args
[R]
Array[Types::t]
Public Class Methods
(location: Location, prefix_location: Location, type_args: Array[Types::t], close_bracket_location: Location, comma_locations: Array[Location]) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 195 def initialize(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:) super(location, prefix_location) @type_args = type_args @close_bracket_location = close_bracket_location @comma_locations = comma_locations end
Calls superclass method
RBS::AST::Ruby::Annotations::Base::new
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 202 def map_type_name(&block) mapped_type_args = type_args.map { |type| type.map_type_name { yield _1 } } self.class.new( location:, prefix_location:, type_args: mapped_type_args, close_bracket_location:, comma_locations: ) #: self end
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 214 def type_fingerprint [ "annots/type_application", type_args.map(&:to_s) ] end