Changes in src/SymTab/Validate.cc [5c4d27f:8e0147a]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/SymTab/Validate.cc
r5c4d27f r8e0147a 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 433 425 void LinkReferenceToTypes::postvisit( StructInstType *structInst ) { 434 426 StructDecl *st = local_indexer->lookupStruct( structInst->get_name() ); … … 442 434 forwardStructs[ structInst->get_name() ].push_back( structInst ); 443 435 } // if 444 checkGenericParameters( structInst );445 436 } 446 437 … … 455 446 forwardUnions[ unionInst->get_name() ].push_back( unionInst ); 456 447 } // if 457 checkGenericParameters( unionInst );458 448 } 459 449 … … 535 525 // need to carry over the 'sized' status of each decl in the instance 536 526 for ( auto p : group_iterate( traitDecl->get_parameters(), traitInst->get_parameters() ) ) { 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 } 527 TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( std::get<1>(p) ); 541 528 if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) { 542 529 TypeDecl * formalDecl = std::get<0>(p);
Note: See TracChangeset
for help on using the changeset viewer.