function IRCompoundType(fields_specification, allow_unknown_keys) {
  if (!fields_specification) {
    throw new Error("Specification for valid fields must be provided");
  }

  allow_unknown_keys = allow_unknown_keys || false;

  var stored_fields = {};
  for (var key in fields_specification) {
    var key_value = fields_specification[key];

    if (!(key_value instanceof IRType)) {
      throw new Error("All keys must be set to IRTypes");
    }

    if (allow_unknown_keys || (!allow_unknown_keys && !(key_value instanceof IRVoidType))) {
      stored_fields[key] = key_value;
    }
  }

  this._fields_specification = stored_fields;
  this._allow_unknown_keys = allow_unknown_keys;
}
/**
 * @constructor
 * @extends IRType
 * @param {Object.<string, IRType>} fields_specification The fields and required type for that field, can contain nested IRCompoundTypes.
 * @param {boolean} [allow_unknown_keys=false]
 */
@constructor
@extends IRType
@param {Object.} fields_specification The fields and required type for that field, can contain nested IRCompoundTypes.
@constructor @extends IRType @param { Object . } fields_specification The fields and required type for that field can contain nested IRCompoundTypes .
function IRCompoundType(fields_specification, allow_unknown_keys) {
  if (!fields_specification) {
    throw new Error("Specification for valid fields must be provided");
  }
  allow_unknown_keys = allow_unknown_keys || false;
  var stored_fields = {};
  for (var key in fields_specification) {
    var key_value = fields_specification[key];
    if (!(key_value instanceof IRType)) {
      throw new Error("All keys must be set to IRTypes");
    }
    if (allow_unknown_keys || (!allow_unknown_keys && !(key_value instanceof IRVoidType))) {
      stored_fields[key] = key_value;
    }
  }
  this._fields_specification = stored_fields;
  this._allow_unknown_keys = allow_unknown_keys;
}
function IRCompoundType ( fields_specification , allow_unknown_keys ) { if ( ! fields_specification ) { throw new Error ( "Specification for valid fields must be provided" ) ; } allow_unknown_keys = allow_unknown_keys || false ; var stored_fields = { } ; for ( var key in fields_specification ) { var key_value = fields_specification [ key ] ; if ( ! ( key_value instanceof IRType ) ) { throw new Error ( "All keys must be set to IRTypes" ) ; } if ( allow_unknown_keys || ( ! allow_unknown_keys && ! ( key_value instanceof IRVoidType ) ) ) { stored_fields [ key ] = key_value ; } } this . _fields_specification = stored_fields ; this . _allow_unknown_keys = allow_unknown_keys ; }
@constructor
 @extends IRType
 @param {Object.<string, IRType>} fields_specification The fields and required type for that field, can contain nested IRCompoundTypes.
@constructor @extends IRType @param { Object . <string IRType > } fields_specification The fields and required type for that field can contain nested IRCompoundTypes .