From c4d1ae5d54cd1214081afa700eb3398fd004ff61 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Wed, 28 Nov 2007 03:34:37 +0100 Subject: [PATCH] [svn r128] function local typedefs were not working --- gen/toir.cpp | 6 ++++++ test/bug78.d | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 test/bug78.d diff --git a/gen/toir.cpp b/gen/toir.cpp index ee4c7c67..64c24bfc 100644 --- a/gen/toir.cpp +++ b/gen/toir.cpp @@ -104,6 +104,12 @@ DValue* DeclarationExp::toElem(IRState* p) Logger::println("ClassDeclaration"); DtoForceConstInitDsymbol(e); } + // typedef + else if (TypedefDeclaration* tdef = declaration->isTypedefDeclaration()) + { + Logger::println("TypedefDeclaration"); + tdef->type->getTypeInfo(NULL); + } // unsupported declaration else { diff --git a/test/bug78.d b/test/bug78.d new file mode 100644 index 00000000..68a011d1 --- /dev/null +++ b/test/bug78.d @@ -0,0 +1,8 @@ +module bug78; + +void main() +{ + typedef int int_t = 42; + int_t i; + assert(i == int_t.init); +} \ No newline at end of file