Changeset 5c4d27f


Ignore:
Timestamp:
Nov 17, 2017, 5:38:36 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
98a249f, c0b23644
Parents:
48fa824
Message:

Add error check for unimplemented expression parameters for trait types [fixes #60]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r48fa824 r5c4d27f  
    535535                // need to carry over the 'sized' status of each decl in the instance
    536536                for ( auto p : group_iterate( traitDecl->get_parameters(), traitInst->get_parameters() ) ) {
    537                         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                        }
    538541                        if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) {
    539542                                TypeDecl * formalDecl = std::get<0>(p);
Note: See TracChangeset for help on using the changeset viewer.