Changeset c0b23644
- Timestamp:
- Nov 20, 2017, 11:44:27 AM (7 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:
- a94b829, fdd3786
- Parents:
- c38ae92 (diff), 5c4d27f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
rc38ae92 rc0b23644 423 423 } 424 424 425 void checkGenericParameters( ReferenceToType * inst ) { 426 for ( Expression * param : inst->parameters ) { 427 if ( ! dynamic_cast< TypeExpr * >( param ) ) { 428 throw SemanticError( "Expression parameters for generic types are currently unsupported: ", inst ); 429 } 430 } 431 } 432 425 433 void LinkReferenceToTypes::postvisit( StructInstType *structInst ) { 426 434 StructDecl *st = local_indexer->lookupStruct( structInst->get_name() ); … … 434 442 forwardStructs[ structInst->get_name() ].push_back( structInst ); 435 443 } // if 444 checkGenericParameters( structInst ); 436 445 } 437 446 … … 446 455 forwardUnions[ unionInst->get_name() ].push_back( unionInst ); 447 456 } // if 457 checkGenericParameters( unionInst ); 448 458 } 449 459 … … 525 535 // need to carry over the 'sized' status of each decl in the instance 526 536 for ( auto p : group_iterate( traitDecl->get_parameters(), traitInst->get_parameters() ) ) { 527 TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( std::get<1>(p) ); 537 TypeExpr * expr = dynamic_cast< TypeExpr * >( std::get<1>(p) ); 538 if ( ! expr ) { 539 throw SemanticError( "Expression parameters for trait instances are currently unsupported: ", std::get<1>(p) ); 540 } 528 541 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) { 529 542 TypeDecl * formalDecl = std::get<0>(p);
Note: See TracChangeset
for help on using the changeset viewer.