Bug 22205 – catch(Exception) not longer working in debug blocks

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2021-08-12T17:26:09Z
Last change time
2021-09-30T01:45:59Z
Keywords
pull
Assigned to
No Owner
Creator
RK

Comments

Comment #0 by frame86 — 2021-08-12T17:26:09Z
void f(T)(int num) { import core.stdc.stdio; printf("recognized %d as %s\n", num, T.stringof.ptr); } void main() { try { throw new Exception(""); } catch (Exception) { f!Exception(1); } catch (Throwable) { f!Throwable(1); } debug { try { throw new Exception(""); } catch (Exception) { f!Exception(2); } catch (Throwable) { f!Throwable(2); } } } prints: recognized 1 as Exception recognized 2 as Throwable It seems that the catch-block is removed from the AST.
Comment #1 by razvan.nitu1305 — 2021-09-09T11:59:14Z
Comment #2 by dlang-bot — 2021-09-09T15:29:06Z
@RazvanN7 created dlang/dmd pull request #13061 "Fix Issue 22205 - catch(Exception) not longer working in debug blocks" fixing this issue: - Fix Issue 22205 - catch(Exception) not longer working in debug blocks https://github.com/dlang/dmd/pull/13061
Comment #3 by dlang-bot — 2021-09-10T02:07:48Z
dlang/dmd pull request #13061 "Fix Issue 22205 - catch(Exception) not longer working in debug blocks" was merged into stable: - 055005addfb970eefcd70c69e2dc93f1244c6bd1 by RazvanN7: Fix Issue 22205 - catch(Exception) not longer working in debug blocks https://github.com/dlang/dmd/pull/13061
Comment #4 by dlang-bot — 2021-09-30T01:45:59Z
dlang/dmd pull request #13108 "merge stable" was merged into master: - b5c146063dc86561e7ea01ac983b5e26723def25 by RazvanN7: Fix Issue 22205 - catch(Exception) not longer working in debug blocks https://github.com/dlang/dmd/pull/13108