Changeset 10c1770
- Timestamp:
- Mar 26, 2025, 5:30:13 PM (4 days ago)
- Branches:
- master
- Children:
- 185cd94
- Parents:
- 30bf6bf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/ResolvExpr/Resolver.cpp ¶
r30bf6bf r10c1770 703 703 } else { 704 704 if ( !objectDecl->isTypeFixed ) { 705 auto newDecl = fixObjectType(objectDecl, context); 706 auto mutDecl = mutate(newDecl); 705 objectDecl = fixObjectType(objectDecl, context); 707 706 708 707 // generate CtorInit wrapper when necessary. … … 710 709 // this object in visitor pass, thus disabling CtorInit codegen. 711 710 // this happens on aggregate members and function parameters. 712 if ( shouldGenCtorInit( mutDecl ) ) {711 if ( shouldGenCtorInit( objectDecl ) ) { 713 712 // constructed objects cannot be designated 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 } 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 @=." ); 721 718 } 722 719 // constructed objects should not have initializers nested too deeply 723 if ( ! InitTweak::checkInitDepth( mutDecl ) ) SemanticError( mutDecl, "Managed object's initializer is too deep " ); 724 725 mutDecl->init = InitTweak::genCtorInit( mutDecl->location, mutDecl ); 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 ) ); 726 724 } 727 728 objectDecl = mutDecl;729 725 } 730 726 currentObject = ast::CurrentObject{ objectDecl->location, objectDecl->get_type() };
Note: See TracChangeset
for help on using the changeset viewer.