Exemplo n.º 1
0
static SILType applyContextArchetypes(IRGenFunction &IGF,
                                      SILType type) {
  if (!type.hasTypeParameter()) {
    return type;
  }

  auto substType =
    IGF.IGM.getGenericEnvironment()->mapTypeIntoContext(
                                                    IGF.getSwiftModule(),
                                                    type.getSwiftRValueType())

      ->getCanonicalType();
  return SILType::getPrimitiveType(substType, type.getCategory());
}