From eb0697d6e472c50d6d0b9e0c6fa372353cc75841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Sat, 5 Nov 2016 01:42:20 +0100 Subject: [PATCH] Let types that implicitly convert to interface pass interface check. "null" in particular is now considered to pass the interface conformance check. --- source/vibe/internal/traits.d | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/vibe/internal/traits.d b/source/vibe/internal/traits.d index 1b43f67..6d26ea4 100644 --- a/source/vibe/internal/traits.d +++ b/source/vibe/internal/traits.d @@ -451,7 +451,9 @@ template checkInterfaceConformance(T, I) { } else enum string impl = null; } - static if (is(T == struct) || is(T == class) || is(T == interface)) + static if (is(T : I)) + enum checkInterfaceConformance = null; + else static if (is(T == struct) || is(T == class) || is(T == interface)) enum checkInterfaceConformance = impl!0; else enum checkInterfaceConformance = "Aggregate type expected, not " ~ T.stringof;