class RBS::DuplicatedInterfaceMethodDefinitionError
An interface mixin causes a duplication of a method definition
interface _Foo1 def foo: () -> void end interface _Foo2 def foo: () -> void end class Foo include _Foo1 include _Foo2 # <= The error will be reported here (or the line of _Foo1) end
Attributes
member
[R]
mixin_member
type
[R]
ty
Public Class Methods
(type: ty, method_name: Symbol, member: mixin_member) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 299 def initialize(type:, method_name:, member:) @type = type @method_name = method_name @member = member super "#{member.location}: Duplicated method definition: #{qualified_method_name}" end
Calls superclass method
Exception::new
Public Instance Methods
() → AST::Members::Mixin::loc?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 307 def location member.location end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 311 def qualified_method_name case type when Types::ClassSingleton "#{type.name}.#{method_name}" else "#{type.name}##{method_name}" end end
() → TypeName
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/errors.rb, line 320 def type_name type.name end