コード例 #1
0
 virtual void visit(NamedType *type)
 {
     FullySpecifiedType ty = rewrite->env->apply(type->name(), rewrite);
     if (! ty->isUndefinedType()) {
         temps.append(ty);
     } else {
         const Name *name = rewrite->rewriteName(type->name());
         temps.append(control()->namedType(name));
     }
 }
コード例 #2
0
FullySpecifiedType SubstitutionEnvironment::apply(const Name *name, Rewrite *rewrite) const
{
    if (name) {
        for (int index = _substs.size() - 1; index != -1; --index) {
            const Substitution *subst = _substs.at(index);

            FullySpecifiedType ty = subst->apply(name, rewrite);
            if (! ty->isUndefinedType())
                return ty;
        }
    }

    return FullySpecifiedType();
}