class IDL::Type::Array
def initialize(t, sizes)
def initialize(t, sizes) raise "Anonymous type definitions are not allowed!" if t.is_anonymous? @basetype = t if sizes.nil? @sizes = [] @typename = t.typename + "[]" else @sizes = sizes @typename = t.typename + sizes.collect { |s| "[#{IDL::Expression::ScopedName === s ? s.node.name : s.to_s}]" }.join end end
def instantiate(instantiation_context)
def instantiate(instantiation_context) self.is_template? ? Type::Array.new(@basetype.instantiate(instantiation_context), @sizes.collect { |sz| sz.instantiate(instantiation_context).value }) : self end
def is_anonymous?
def is_anonymous? true end
def is_complete?
def is_complete? @basetype.resolved_type.is_complete? end
def is_local?(recurstk = [])
def is_local?(recurstk = []) @basetype.resolved_type.is_local?(recurstk) end
def is_template?
def is_template? @sizes.any? { |sz| (sz.is_a?(IDL::Expression::ScopedName) && sz.node.is_a?(IDL::AST::TemplateParam)) } || @basetype.is_template? end
def matches?(idltype)
def matches?(idltype) super && self.sizes == idltype.sizes && self.basetype.resolved_type.matches?(idltype.basetype.resolved_type) end
def narrow(obj)
def narrow(obj) typeerror(obj) end
def typename
def typename @typename end