From 71fed69664ad7119f681e9b6a7ff524a2d002de8 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Wed, 4 Mar 2015 13:26:40 -0800 Subject: [PATCH] Fix #22 --- src/dfmt.d | 7 +++++++ tests/issue0022.d | 6 ++++++ tests/issue0022.d.ref | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 tests/issue0022.d create mode 100644 tests/issue0022.d.ref diff --git a/src/dfmt.d b/src/dfmt.d index b82f140..a037a32 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -347,6 +347,13 @@ private: } goto case; case tok!"~": + if (peekIs(tok!"this")) + { + writeToken(); + break; + } + else + goto case; case tok!"&": case tok!"+": case tok!"-": diff --git a/tests/issue0022.d b/tests/issue0022.d new file mode 100644 index 0000000..4bb072d --- /dev/null +++ b/tests/issue0022.d @@ -0,0 +1,6 @@ +struct X +{ + ~this() + { + } +} diff --git a/tests/issue0022.d.ref b/tests/issue0022.d.ref new file mode 100644 index 0000000..fcb239f --- /dev/null +++ b/tests/issue0022.d.ref @@ -0,0 +1,6 @@ +struct X +{ + ~this() + { + } +}