From 5e98bf3c4918fd2d3208c20657cc08c144e0a8d9 Mon Sep 17 00:00:00 2001 From: Robert Clipsham Date: Sat, 1 Jan 2011 12:00:39 +0000 Subject: [PATCH] Backed out changeset 95acac0ef1cd --- gen/toir.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gen/toir.cpp b/gen/toir.cpp index ada97c7a..519e2aab 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -88,14 +88,7 @@ DValue* VarExp::toElem(IRState* p) cachedLvalue = NULL; return new DVarValue(type, V); } - - // this is an error! must be accessed with DotVarExp - if (var->needThis()) - { - error("need 'this' to access member %s", toChars()); - fatal(); - } - + if (VarDeclaration* vd = var->isVarDeclaration()) { Logger::println("VarDeclaration ' %s ' of type ' %s '", vd->toChars(), vd->type->toChars()); @@ -107,6 +100,14 @@ DValue* VarExp::toElem(IRState* p) return new DConstValue(type, DtoConstBool(false)); } #endif + + // this is an error! must be accessed with DotVarExp + if (var->needThis()) + { + error("need 'this' to access member %s", toChars()); + fatal(); + } + // _arguments if (vd->ident == Id::_arguments && p->func()->_arguments) {