From a37f4a967eafc93eeb97c411b8f14c348287efcc Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 4 Mar 2015 17:16:39 -0800 Subject: [PATCH] Fix #24 --- src/dfmt.d | 4 ++-- tests/issue0024.d | 1 + tests/issue0024.d.ref | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 tests/issue0024.d create mode 100644 tests/issue0024.d.ref diff --git a/src/dfmt.d b/src/dfmt.d index 9124762..2c72155 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -353,7 +353,7 @@ private: write(" "); break; } - goto case; + goto binary; case tok!"~": if (peekIs(tok!"this")) { @@ -361,7 +361,7 @@ private: break; } else - goto case; + goto binary; case tok!"&": case tok!"+": case tok!"-": diff --git a/tests/issue0024.d b/tests/issue0024.d new file mode 100644 index 0000000..fe18df3 --- /dev/null +++ b/tests/issue0024.d @@ -0,0 +1 @@ +complex_t opMul_r(real x){return complex_t(x)*this;} diff --git a/tests/issue0024.d.ref b/tests/issue0024.d.ref new file mode 100644 index 0000000..ca5ade0 --- /dev/null +++ b/tests/issue0024.d.ref @@ -0,0 +1,4 @@ +complex_t opMul_r(real x) +{ + return complex_t(x) * this; +}