resolveDataType()

in src/langs/swift/combinator.js [386:401]


  resolveDataType(gram) {
    let expectedType = null;
    if (gram.returnType) {
      expectedType = gram.returnType;
    } else if (gram.dataType) {
      expectedType = gram.dataType;
    } else if (gram.type instanceof TypeItem) {
      expectedType = gram.type;
    } else if (gram.type === 'call') {
      expectedType = gram.value.returnType;
    }
    if (expectedType === null) {
      return null;
    }
    return this.emitType(expectedType);
  }