Class: DuplicateDefError
- Inherits:
-
CompilerError
- Object
- CompilerError
- DuplicateDefError
- Defined in:
- lib/compiler_error.rb
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(type, name, old_ast, new_ast) ⇒ DuplicateDefError
constructor
A new instance of DuplicateDefError.
Methods inherited from CompilerError
Constructor Details
#initialize(type, name, old_ast, new_ast) ⇒ DuplicateDefError
Returns a new instance of DuplicateDefError.
44 45 46 47 48 49 50 |
# File 'lib/compiler_error.rb', line 44 def initialize type, name, old_ast, new_ast super new_ast.position @type = type @name = name @old_pos = old_ast.position @new_pos = new_ast.position end |
Instance Method Details
#info ⇒ Object
52 53 54 |
# File 'lib/compiler_error.rb', line 52 def info "'#{@name}' : #{@type} redefinition\n #{@old_pos} : see previous #{@type} definition of '#{@name}'" end |