Changes in src/ResolvExpr/Resolver.cpp [10c1770:64f3b9f]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cpp
r10c1770 r64f3b9f 703 703 } else { 704 704 if ( !objectDecl->isTypeFixed ) { 705 objectDecl = fixObjectType(objectDecl, context); 705 auto newDecl = fixObjectType(objectDecl, context); 706 auto mutDecl = mutate(newDecl); 706 707 707 708 // generate CtorInit wrapper when necessary. … … 709 710 // this object in visitor pass, thus disabling CtorInit codegen. 710 711 // this happens on aggregate members and function parameters. 711 if ( shouldGenCtorInit( objectDecl ) ) {712 if ( shouldGenCtorInit( mutDecl ) ) { 712 713 // constructed objects cannot be designated 713 if ( InitTweak::isDesignated( objectDecl->init ) 714 && !ast::Pass<ResolveDesignators>::read( 715 objectDecl->init.get(), context ) ) { 716 SemanticError( objectDecl, "Cannot include designations in the initializer for a managed Object.\n" 717 "If this is really what you want, initialize with @=." ); 714 if ( InitTweak::isDesignated( mutDecl->init ) ) { 715 ast::Pass<ResolveDesignators> res( context ); 716 maybe_accept( mutDecl->init.get(), res ); 717 if ( !res.core.result ) { 718 SemanticError( mutDecl, "Cannot include designations in the initializer for a managed Object.\n" 719 "If this is really what you want, initialize with @=." ); 720 } 718 721 } 719 722 // constructed objects should not have initializers nested too deeply 720 if ( !InitTweak::checkInitDepth( objectDecl ) ) SemanticError( objectDecl, "Managed object's initializer is too deep " ); 721 722 objectDecl = ast::mutate_field( objectDecl, &ast::ObjectDecl::init, 723 InitTweak::genCtorInit( objectDecl->location, objectDecl ) ); 723 if ( ! InitTweak::checkInitDepth( mutDecl ) ) SemanticError( mutDecl, "Managed object's initializer is too deep " ); 724 725 mutDecl->init = InitTweak::genCtorInit( mutDecl->location, mutDecl ); 724 726 } 727 728 objectDecl = mutDecl; 725 729 } 726 730 currentObject = ast::CurrentObject{ objectDecl->location, objectDecl->get_type() };
Note:
See TracChangeset
for help on using the changeset viewer.