Example #1
0
/* Constructs a scalar array with all the shape field names,
 * this/self/parent, classes, type accesses, and type aliases
 * resolved. */
Array TypeStructure::resolve(const Class::Const& typeCns,
                             const Class* typeCnsCls) {
  assert(typeCns.isType());
  assert(typeCns.m_val.m_type == KindOfArray);
  assert(typeCns.m_name);
  assert(typeCnsCls);

  Array arr(typeCns.m_val.m_data.parr);
  return resolveTS(arr, typeCns, typeCnsCls);
}
Example #2
0
/*
 * Constructs a scalar array with all the shape field names, this/self/parent,
 * classes, type accesses, and type aliases resolved.
 */
Array TypeStructure::resolve(const Class::Const& typeCns,
                             const Class* typeCnsCls,
                             bool& persistent) {
  assert(typeCns.isType());
  assert(isArrayType(typeCns.val.m_type));
  assert(typeCns.name);
  assert(typeCnsCls);

  Array arr(typeCns.val.m_data.parr);
  return resolveTS(arr, typeCns, typeCnsCls, Array(), persistent);
}
Example #3
0
/* called by TypeAliasReq to get resolved TypeStructure for type aliases */
Array TypeStructure::resolve(const String& aliasName,
                             const Array& arr) {
  // use a bogus constant to store the name
  Class::Const cns;
  cns.m_name = aliasName.get();

  auto newarr = resolveTS(arr, cns, nullptr);
  newarr.add(s_alias, Variant(aliasName));
  newarr.setEvalScalar();
  return newarr;
}
Example #4
0
/*
 * Called by TypeAliasReq to get resolved TypeStructure for type aliases.
 */
Array TypeStructure::resolve(const String& aliasName,
                             const Array& arr,
                             bool& persistent,
                             const Array& generics) {
  // use a bogus constant to store the name
  Class::Const cns;
  cns.name = aliasName.get();

  auto newarr = resolveTS(arr, cns, nullptr, generics, persistent);
  newarr.add(s_alias, Variant(aliasName));
  return newarr;
}
Example #5
0
/* Constructs a scalar array with all the shape field names, 'this'
 * resolved. TODO(7657500): resolve type access and generic types. */
ArrayData* TypeStructure::resolve(ArrayData* arr,
                                  const Class* typeCnsCls) {
  if (arr == nullptr) return arr;

  return resolveTS(arr, typeCnsCls);
}