Changes in / [c0b23644:c38ae92]


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    rc0b23644 rc38ae92  
    423423        }
    424424
    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 
    433425        void LinkReferenceToTypes::postvisit( StructInstType *structInst ) {
    434426                StructDecl *st = local_indexer->lookupStruct( structInst->get_name() );
     
    442434                        forwardStructs[ structInst->get_name() ].push_back( structInst );
    443435                } // if
    444                 checkGenericParameters( structInst );
    445436        }
    446437
     
    455446                        forwardUnions[ unionInst->get_name() ].push_back( unionInst );
    456447                } // if
    457                 checkGenericParameters( unionInst );
    458448        }
    459449
     
    535525                // need to carry over the 'sized' status of each decl in the instance
    536526                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) );
    541528                        if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) {
    542529                                TypeDecl * formalDecl = std::get<0>(p);
Note: See TracChangeset for help on using the changeset viewer.