From a2f7246c4950cf4a38582de95771c11588ab392a Mon Sep 17 00:00:00 2001 From: kai Date: Thu, 4 Jul 2013 08:06:09 +0200 Subject: [PATCH] Fix for part 1 of issue 424. Yet another difference between static arrays and vectors. Initializing a static array with one element is handled especially. This fix adds the same handling for vector types. --- dmd2/init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dmd2/init.c b/dmd2/init.c index 0835e90d..d59a66ff 100644 --- a/dmd2/init.c +++ b/dmd2/init.c @@ -1022,6 +1022,10 @@ Initializer *ExpInitializer::semantic(Scope *sc, Type *t, NeedInterpret needInte // Look for the case of statically initializing an array // with a single member. +#if IN_LLVM + // Fix for part 1 of issue 424. + if (tb->ty == Tvector) tb = static_cast(tb)->basetype; +#endif if (tb->ty == Tsarray && !tb->nextOf()->equals(ti->toBasetype()->nextOf()) && exp->implicitConvTo(tb->nextOf())