From d6a264e74b716af3fe6473fe184e18c0f7011f9b Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Tue, 17 Feb 2009 18:25:34 +0100 Subject: [PATCH] Fix #216 by implementing TypeExp::toElem. It just provides the appropriate error message. --- gen/toir.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index 6ee7d329..4bb82022 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -2571,11 +2571,21 @@ DValue* DotTypeExp::toElem(IRState* p) ////////////////////////////////////////////////////////////////////////////////////////// +DValue* TypeExp::toElem(IRState *p) +{ + error("type %s is not an expression", toChars()); + //TODO: Improve error handling. DMD just returns some value here and hopes + // some more sensible error messages will be triggered. + fatal(); + return NULL; +} + +////////////////////////////////////////////////////////////////////////////////////////// + #define STUB(x) DValue *x::toElem(IRState * p) {error("Exp type "#x" not implemented: %s", toChars()); fatal(); return 0; } STUB(Expression); STUB(TypeDotIdExp); STUB(ScopeExp); -STUB(TypeExp); STUB(TupleExp); #if DMDV2