Ignore:
Timestamp:
Jul 13, 2024, 3:29:22 PM (3 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
2e6b2a0
Parents:
76b507d
Message:

Remove automatic conversion from Enum type name to its len; change With() semantic for enum to avoid type ambiguity (not fully implemented)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cpp

    r76b507d r8315947  
    322322
    323323namespace {
    324         bool structOrUnion( const Candidate & i ) {
     324        bool structOrUnionOrEnum( const Candidate & i ) {
    325325                const ast::Type * t = i.expr->result->stripReferences();
    326                 return dynamic_cast< const ast::StructInstType * >( t ) || dynamic_cast< const ast::UnionInstType * >( t );
     326                return dynamic_cast< const ast::StructInstType * >( t ) || dynamic_cast< const ast::UnionInstType * >( t ) || dynamic_cast< const ast::EnumInstType * >( t );
    327327        }
    328328        /// Predicate for "Candidate has integral type"
     
    11401140        for (auto & expr : exprs) {
    11411141                // only struct- and union-typed expressions are viable candidates
    1142                 expr = findKindExpression( expr, context, structOrUnion, "with expression" );
     1142                expr = findKindExpression( expr, context, structOrUnionOrEnum, "with expression" );
    11431143
    11441144                // if with expression might be impure, create a temporary so that it is evaluated once
Note: See TracChangeset for help on using the changeset viewer.