From 745ffd6a5b91186e1b9f396f746daa6fce93d0ce Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Sun, 8 Mar 2015 18:37:05 -0700 Subject: [PATCH] Fix #66 --- src/dfmt.d | 5 ++++- tests/issue0066.d | 8 ++++++++ tests/issue0066.d.ref | 8 ++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/issue0066.d create mode 100644 tests/issue0066.d.ref diff --git a/src/dfmt.d b/src/dfmt.d index 7052a4a..c371d04 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -374,8 +374,11 @@ private: .equalRange(current.index).empty) { writeToken(); - if (!currentIs(tok!"*") && !currentIs(tok!")") && !currentIs(tok!"[")) + if (!currentIs(tok!"*") && !currentIs(tok!")") && !currentIs(tok!"[") + && !currentIs(tok!",")) + { write(" "); + } break; } else if (assumeSorted(astInformation.unaryLocations).equalRange(current.index).empty) diff --git a/tests/issue0066.d b/tests/issue0066.d new file mode 100644 index 0000000..4c09e1f --- /dev/null +++ b/tests/issue0066.d @@ -0,0 +1,8 @@ +int overloadApply(int function(void*, Dsymbol) fp) +{ +} + +void takesArray(int[]) +{ + doesntUseArray(); +} diff --git a/tests/issue0066.d.ref b/tests/issue0066.d.ref new file mode 100644 index 0000000..8928906 --- /dev/null +++ b/tests/issue0066.d.ref @@ -0,0 +1,8 @@ +int overloadApply(int function(void*, Dsymbol) fp) +{ +} + +void takesArray(int[]) +{ + doesntUseArray(); +}