Mercurial > projects > ldc
comparison gen/toir.cpp @ 973:d96471e8b5e5
Fix #216 by implementing TypeExp::toElem. It just provides the appropriate
error message.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Tue, 17 Feb 2009 18:25:34 +0100 |
parents | 2ebac4750adb |
children | 73ff89728d85 |
comparison
equal
deleted
inserted
replaced
972:d66ab756c75b | 973:d96471e8b5e5 |
---|---|
2569 return e1->toElem(p); | 2569 return e1->toElem(p); |
2570 } | 2570 } |
2571 | 2571 |
2572 ////////////////////////////////////////////////////////////////////////////////////////// | 2572 ////////////////////////////////////////////////////////////////////////////////////////// |
2573 | 2573 |
2574 DValue* TypeExp::toElem(IRState *p) | |
2575 { | |
2576 error("type %s is not an expression", toChars()); | |
2577 //TODO: Improve error handling. DMD just returns some value here and hopes | |
2578 // some more sensible error messages will be triggered. | |
2579 fatal(); | |
2580 return NULL; | |
2581 } | |
2582 | |
2583 ////////////////////////////////////////////////////////////////////////////////////////// | |
2584 | |
2574 #define STUB(x) DValue *x::toElem(IRState * p) {error("Exp type "#x" not implemented: %s", toChars()); fatal(); return 0; } | 2585 #define STUB(x) DValue *x::toElem(IRState * p) {error("Exp type "#x" not implemented: %s", toChars()); fatal(); return 0; } |
2575 STUB(Expression); | 2586 STUB(Expression); |
2576 STUB(TypeDotIdExp); | 2587 STUB(TypeDotIdExp); |
2577 STUB(ScopeExp); | 2588 STUB(ScopeExp); |
2578 STUB(TypeExp); | |
2579 STUB(TupleExp); | 2589 STUB(TupleExp); |
2580 | 2590 |
2581 #if DMDV2 | 2591 #if DMDV2 |
2582 STUB(SymbolExp); | 2592 STUB(SymbolExp); |
2583 #endif | 2593 #endif |