Method: RBS::Environment::MultiEntry#validate_type_params

Defined in:
lib/rbs/environment.rb

#validate_type_paramsObject



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/rbs/environment.rb', line 53

def validate_type_params
  unless decls.empty?
    hd_decl, *tl_decls = decls
    raise unless hd_decl

    hd_params = hd_decl.decl.type_params

    tl_decls.each do |tl_decl|
      tl_params = tl_decl.decl.type_params

      unless compatible_params?(hd_params, tl_params)
        raise GenericParameterMismatchError.new(name: name, decl: _ = tl_decl.decl)
      end
    end
  end
end