From 5b8118170088071386bb76e3d7a4b1ceb685e73a Mon Sep 17 00:00:00 2001 From: k-hara Date: Tue, 20 Sep 2011 23:11:55 +0900 Subject: [PATCH] Support conversions between class and interface --- std/conv.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std/conv.d b/std/conv.d index 24cb45e548e..48d639e6813 100644 --- a/std/conv.d +++ b/std/conv.d @@ -550,8 +550,8 @@ non-null and the target is null. */ T toImpl(T, S)(S value) if (!isImplicitlyConvertible!(S, T) && - is(S : Object) && !is(typeof(value.opCast!T()) : T) && - is(T : Object) && !is(typeof(new T(value)))) + (is(S == class) || is(S == interface)) && !is(typeof(value.opCast!T()) : T) && + (is(T == class) || is(T == interface)) && !is(typeof(new T(value)))) { static if (is(T == immutable)) {