| 1380 | // Node for compilation of if(){}else{} statement and conditional operator ?: |
| 1381 | |
| 1382 | NodeIfElseExpr::NodeIfElseExpr(bool haveElse, bool isTerm) |
| 1383 | { |
| 1384 | // If else block is present |
| 1385 | if(haveElse) |
| 1386 | third = TakeLastNode(); |
| 1387 | |
| 1388 | second = TakeLastNode(); |
| 1389 | first = TakeLastNode(); |
| 1390 | |
| 1391 | if((first->typeInfo->type == TypeInfo::TYPE_COMPLEX && first->typeInfo != typeObject) || first->typeInfo->type == TypeInfo::TYPE_VOID) |
| 1392 | ThrowError(CodeInfo::lastKnownStartPos, "ERROR: condition type cannot be '%s' and function for conversion to bool is undefined", first->typeInfo->GetFullTypeName()); |
| 1393 | // If it is a conditional operator, the there is a resulting type different than void |
| 1394 | if(isTerm) |
| 1395 | typeInfo = second->typeInfo != third->typeInfo ? ChooseBinaryOpResultType(second->typeInfo, third->typeInfo) : second->typeInfo; |
| 1396 | |
| 1397 | nodeType = typeNodeIfElseExpr; |
| 1398 | } |
| 1399 | NodeIfElseExpr::~NodeIfElseExpr() |
| 1400 | { |
| 1401 | } |
nothing calls this directly
no test coverage detected