File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -917,9 +917,22 @@ if (!is(S : T) &&
917
917
auto result = ()@trusted { return cast (T) value; }();
918
918
if (! result && value)
919
919
{
920
- throw new ConvException(" Cannot convert object of static type "
921
- ~ S.classinfo.name~ " and dynamic type " ~ value.classinfo.name
922
- ~ " to type " ~ T.classinfo.name);
920
+ static if (is (S == interface ))
921
+ {
922
+ auto nameDyn = typeid (value).info.name;
923
+ auto nameS = typeid (S).info.name;
924
+ }
925
+ else
926
+ {
927
+ auto nameDyn = typeid (value).info;
928
+ auto nameS = typeid (S).info;
929
+ }
930
+ static if (is (T == interface ))
931
+ auto nameT = typeid (T).info.name;
932
+ else
933
+ auto nameT = typeid (T).name;
934
+ throw new ConvException(" Cannot convert object of static type " ~
935
+ nameS ~ " and dynamic type " ~ nameDyn ~ " to type " ~ nameT);
923
936
}
924
937
return result;
925
938
}
You can’t perform that action at this time.
0 commit comments