This class is a catch-all. The constructor of this class must be called from children via super() in order to assign the position field variable.
The optional arguments are args = file name args = line number
args[2] = column position or args[0] = a Position, ObjectPosition, or Context object
Speficies the context of the type.
# File lib/rubybreaker/type/type.rb, line 47 def initialize(*args) case args[0] when Context @ctx = args[0] when Position @ctx = Context.new(args[0]) when ObjectPosition @ctx = Context.new(args[0]) else file = args[0] line = args[1] col = args[2] pos = Position.new(file,line,col) @ctx = Context.new(pos) end end
This method compares this object to another object syntactically.
# File lib/rubybreaker/type/type_comparer.rb, line 139 def eql?(other) TypeComparer.compare(self, other) end
This is a shorthand for calling RubyBreaker::Typing.subtype_rel?
# File lib/rubybreaker/typing/subtyping.rb, line 480 def subtype_of?(rhs) return Typing.subtype_rel?(self,rhs) end
This method is a shorthand for calling RubyBreaker::TypeUnparser.unparse.
# File lib/rubybreaker/type/type_unparser.rb, line 176 def unparse(opts={}) TypeUnparser.unparse(self, opts) end