Skip to content

Commit

Permalink
Support conversions between class and interface
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Sep 22, 2011
1 parent 1ef1c5c commit 5b81181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions std/conv.d
Expand Up @@ -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))
{
Expand Down

0 comments on commit 5b81181

Please sign in to comment.