From 3a3eb73006e8251625963c18eed950fceba155b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Fri, 27 Jan 2017 00:51:22 +0100 Subject: [PATCH] Fix InterfaceProxy when used with class instances. --- source/vibe/internal/interfaceproxy.d | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/vibe/internal/interfaceproxy.d b/source/vibe/internal/interfaceproxy.d index 7ba4334..e98cf7c 100644 --- a/source/vibe/internal/interfaceproxy.d +++ b/source/vibe/internal/interfaceproxy.d @@ -81,7 +81,8 @@ struct InterfaceProxy(I) if (is(I == interface)) { static assert(O.sizeof <= m_value.length, "Object ("~O.stringof~") is too big to be stored in an InterfaceProxy."); import std.conv : emplace; m_intf = ProxyImpl!O.get(); - emplace!O(m_value[0 .. O.sizeof]); + static if (is(O == struct)) + emplace!O(m_value[0 .. O.sizeof]); (cast(O[])m_value[0 .. O.sizeof])[0] = object; }