class RBS::MixinClassError

属性

member[R]
type_name[R]

公共类方法

check!(type_name:, env:, member:) 点击切换源代码
# File rbs-3.8.0/lib/rbs/errors.rb, line 460
def self.check!(type_name:, env:, member:)
  if env.class_decl?(member.name)
    raise new(type_name: type_name, member: member)
  end
end
new(type_name:, member:) 点击切换源代码
调用父类方法
# File rbs-3.8.0/lib/rbs/errors.rb, line 449
def initialize(type_name:, member:)
  @type_name = type_name
  @member = member

  super "#{Location.to_string member.location}: Cannot #{mixin_name} a class `#{member.name}` in the definition of `#{type_name}`"
end

公共实例方法

location() 点击切换源代码
# File rbs-3.8.0/lib/rbs/errors.rb, line 456
def location
  member.location
end

私有实例方法

mixin_name() 点击切换源代码
# File rbs-3.8.0/lib/rbs/errors.rb, line 468
def mixin_name
  case member
  when AST::Members::Prepend
    "prepend"
  when AST::Members::Include
    "include"
  when AST::Members::Extend
    "extend"
  else
    raise
  end
end