Ignore:
Timestamp:
Mar 3, 2016, 2:45:51 PM (6 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, ctor, deferred_resn, demangler, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
620cb95
Parents:
c14cff1
Message:

removed array ctor/dtors from prelude, generalized struct routine generation, fix fall back on initializer if ctor not found, begin special casing array ctor/dtor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    rc14cff1 r071a31a  
    479479                TypeEnvironment env;
    480480                AlternativeFinder finder( *this, env );
    481                 finder.find( ctorInit->get_ctor() );
    482 
    483                 if ( finder.get_alternatives().size() == 0 ) {
     481                try {
     482                        finder.find( ctorInit->get_ctor() );
     483                } catch ( SemanticError ) {
     484                        // no alternatives for the constructor initializer - fallback on C-style initializer
     485                        // xxx- not sure if this makes a ton of sense - should maybe never be able to have this situation?
    484486                        fallbackInit( ctorInit );
    485                 } else if ( finder.get_alternatives().size() == 1 ) {
     487                        return;
     488                }
     489
     490                assert( ! finder.get_alternatives().empty() );
     491
     492                if ( finder.get_alternatives().size() == 1 ) {
    486493                        Alternative &choice = finder.get_alternatives().front();
    487494                        if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( choice.expr ) ) {
Note: See TracChangeset for help on using the changeset viewer.