Changeset a55ebcc for src/Validate/FixQualifiedTypes.cpp
- Timestamp:
- Feb 5, 2024, 2:17:33 AM (7 months ago)
- Branches:
- master
- Children:
- 47bd204
- Parents:
- 020fa10
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Validate/FixQualifiedTypes.cpp
r020fa10 ra55ebcc 89 89 } 90 90 91 ast::Expr const * postvisit( ast::QualifiedNameExpr const * t ) {92 assert( location );93 if ( !t->type_decl ) return t;94 95 auto enumName = t->type_decl->name;96 const ast::EnumDecl * enumDecl = symtab.lookupEnum( enumName );97 for ( ast::ptr<ast::Decl> const & member : enumDecl->members ) {98 if ( auto memberAsObj = member.as<ast::ObjectDecl>() ) {99 if ( memberAsObj->name == t->name ) {100 return new ast::VariableExpr( t->location, memberAsObj );101 }102 } else {103 assertf( false, "unhandled qualified child type" );104 }105 }106 107 auto var = new ast::ObjectDecl( t->location, t->name,108 new ast::EnumInstType( enumDecl, ast::CV::Const ),109 nullptr, {}, ast::Linkage::Cforall );110 var->mangleName = Mangle::mangle( var );111 return new ast::VariableExpr( t->location, var );112 }113 114 91 }; 115 92
Note: See TracChangeset
for help on using the changeset viewer.