From 691a922850965522de8f8d0aa4a7c45b13846cb5 Mon Sep 17 00:00:00 2001 From: Tomas Lindquist Olsen Date: Mon, 4 Aug 2008 17:32:13 +0200 Subject: [PATCH] Changed DMD to make a copy of the TypeFunction in DelegateExp. --- dmd/expression.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dmd/expression.c b/dmd/expression.c index 362a11d4..1656393d 100644 --- a/dmd/expression.c +++ b/dmd/expression.c @@ -5373,7 +5373,8 @@ Expression *DelegateExp::semantic(Scope *sc) if (!type) { e1 = e1->semantic(sc); - type = new TypeDelegate(func->type); + // LLVMDC we need a copy as we store the LLVM tpye in TypeFunction, and delegate/members have different types for 'this' + type = new TypeDelegate(func->type->syntaxCopy()); type = type->semantic(loc, sc); AggregateDeclaration *ad = func->toParent()->isAggregateDeclaration(); if (func->needThis())