function getOptTypesFrom(block, name) {
  var types = getTypesFrom_(block, name);
  if (types.length == 0) {
    return undefined;
  } else if (types.indexOf('null') != -1) {
    return 'null';
  } else if (types.length == 1) {
    return types[0];
  } else {
    return '[' + types.join(', ') + ']';
  }
}
Fetch the type(s) defined in the given input.
Format as a string for appending to the generated code.
@param {!Blockly.Block} block Block with input.
@param {string} name Name of the input.
@return {?string} String defining the types.