| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/ice2843.d(22): Error: incompatible types for `(1) is (typeid(int))`: `int` and `object.TypeInfo` |
| 5 |
--- |
| 6 |
*/ |
| 7 |
|
| 8 |
// https://issues.dlang.org/show_bug.cgi?id=2843 |
| 9 |
// ICE(constfold.c) with is-expression with invalid dot-expression in is-expression involving typeid expression |
| 10 |
/* 2843 Assertion failure: '0' on line 863 in file 'constfold.c' |
| 11 |
PATCH: constfold.c, line 861: |
| 12 |
OLD: |
| 13 |
}else |
| 14 |
assert(0); |
| 15 |
NEW: |
| 16 |
}else if (e1->isConst() && e2->isConst()) { |
| 17 |
// Comparing a SymExp with a literal, eg typeid(int) is 7.1; |
| 18 |
cmp=0; // An error has already occurred. Prevent an ICE. |
| 19 |
}else |
| 20 |
assert(0); |
| 21 |
*/ |
| 22 |
bool b = 1 is typeid(int); |