Changeset 0215a76f


Ignore:
Timestamp:
Jul 10, 2015, 4:35:25 PM (7 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, resolv-new, string, with_gc
Children:
9163b9c
Parents:
cff1143
Message:

Copy instance parameters over typedefs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rcff1143 r0215a76f  
    812812                        Type *ret = def->second.first->get_base()->clone();
    813813                        ret->get_qualifiers() += typeInst->get_qualifiers();
     814                        // place instance parameters on the typedef'd type
     815                        if ( ! typeInst->get_parameters().empty() ) {
     816                                ReferenceToType *rtt = dynamic_cast<ReferenceToType*>(ret);
     817                                if ( ! rtt ) {
     818                                        throw SemanticError("cannot apply type parameters to base type of " + typeInst->get_name());
     819                                }
     820                                rtt->get_parameters().clear();
     821                                cloneAll(typeInst->get_parameters(), rtt->get_parameters());
     822                        }
    814823                        delete typeInst;
    815824                        return ret;
Note: See TracChangeset for help on using the changeset viewer.