Changeset 2c57025 for src/SymTab
- Timestamp:
- Nov 25, 2016, 6:11:03 PM (8 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 0f35657
- Parents:
- 186fd86
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r186fd86 r2c57025 361 361 void Pass2::visit( TraitInstType *contextInst ) { 362 362 Parent::visit( contextInst ); 363 if ( contextInst->get_name() == "sized" ) { 364 // "sized" is a special trait with no members - just flick the sized status on for the type variable 365 if ( contextInst->get_parameters().size() != 1 ) { 366 throw SemanticError( "incorrect number of context parameters: ", contextInst ); 367 } 368 TypeExpr * param = safe_dynamic_cast< TypeExpr * > ( contextInst->get_parameters().front() ); 369 TypeInstType * inst = safe_dynamic_cast< TypeInstType * > ( param->get_type() ); 370 TypeDecl * decl = inst->get_baseType(); 371 decl->set_sized( true ); 372 // since "sized" is special, the next few steps don't apply 373 return; 374 } 363 375 TraitDecl *ctx = indexer->lookupTrait( contextInst->get_name() ); 364 376 if ( ! ctx ) { … … 584 596 585 597 typedeclNames[ typeDecl->get_name() ] = typeDecl; 586 return typeDecl;598 return Mutator::mutate( typeDecl ); 587 599 } 588 600
Note: See TracChangeset
for help on using the changeset viewer.