Changes in src/ResolvExpr/Resolver.cpp [ed96731:8315947]
- File:
-
- 1 edited
-
src/ResolvExpr/Resolver.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Resolver.cpp
red96731 r8315947 201 201 && typesCompatible( castExpr->arg->result, castExpr->result ) 202 202 ) { 203 ast::EnumInstType const * arg, * result; 204 if ( ( result = castExpr->result.as<ast::EnumInstType>() ) && 205 ( arg = castExpr->arg.as<ast::EnumInstType>() ) && 206 arg->base->name != result->base->name) { 207 return castExpr; 203 auto argAsEnum = castExpr->arg.as<ast::EnumInstType>(); 204 auto resultAsEnum = castExpr->result.as<ast::EnumInstType>(); 205 if (argAsEnum && resultAsEnum) { 206 if (argAsEnum->base->name != resultAsEnum->base->name) { 207 std::cerr << "Enum Cast: " << argAsEnum->base->name << " to " << resultAsEnum->base->name << std::endl; 208 return castExpr; 209 } 208 210 } 209 211 // generated cast is the same type as its argument, remove it after keeping env … … 375 377 : public ast::WithSymbolTable, public ast::WithGuards, 376 378 public ast::WithVisitorRef<Resolver>, public ast::WithShortCircuiting, 377 public ast::WithStmtsToAdd {379 public ast::WithStmtsToAdd<> { 378 380 379 381 ast::ptr< ast::Type > functionReturn = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.