Fixes Issue 8143 - Safe std.conv.to enum conversion