diff options
Diffstat (limited to 'libphobos/src/std/typecons.d')
-rw-r--r-- | libphobos/src/std/typecons.d | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libphobos/src/std/typecons.d b/libphobos/src/std/typecons.d index 1ee7faaee7b..fb15001233a 100644 --- a/libphobos/src/std/typecons.d +++ b/libphobos/src/std/typecons.d @@ -4905,8 +4905,14 @@ if (is(Interface == interface) && is(BaseClass == class)) // - try default first // - only on a failure run & return fallback enum fallback = q{ - scope (failure) return fallback.%1$s(args); - return default_.%1$s(args); + try + { + return default_.%1$s(args); + } + catch (Exception) + { + return fallback.%1$s(args); + } }.format(__traits(identifier, func)); } |