Module: Sequel

Extended by:
RDL::Annotate
Defined in:
lib/types/sequel/comp_types.rb

Class Method Summary collapse

Methods included from RDL::Annotate

attr_accessor_type, attr_reader_type, attr_writer_type, post, pre, rdl_alias, readd_comp_types, type, type_params, var_type

Class Method Details

.gen_output_type(targ) ⇒ Object



66
67
68
69
70
71
72
73
# File 'lib/types/sequel/comp_types.rb', line 66

def self.gen_output_type(targ)
  case targ
  when RDL::Type::SingletonType
    RDL::Type::GenericType.new(RDL::Type::NominalType.new(SeqIdent), targ)
  else
    raise "unexpected type"
  end
end

.qualify_output_type(targs) ⇒ Object



76
77
78
79
# File 'lib/types/sequel/comp_types.rb', line 76

def self.qualify_output_type(targs)
  raise "unexpected types" unless targs.all? { |a| a.is_a?(RDL::Type::SingletonType) }
  RDL::Type::GenericType.new(RDL::Type::NominalType.new(SeqQualIdent), targs[0], targs[1])
end