diff --git a/src/dfmt.d b/src/dfmt.d index f7c873f..e61f639 100644 --- a/src/dfmt.d +++ b/src/dfmt.d @@ -776,7 +776,7 @@ private: formatAt(); break; case tok!"!": - if (peekIs(tok!"is")) + if (peekIs(tok!"is") && !(peekBackIs(tok!"(") || peekBackIs(tok!"="))) write(" "); goto case; case tok!"...": diff --git a/tests/allman/issue0116.d.ref b/tests/allman/issue0116.d.ref new file mode 100644 index 0000000..dad966e --- /dev/null +++ b/tests/allman/issue0116.d.ref @@ -0,0 +1,8 @@ +static assert(!is(T : int)); + +unittest +{ + foo(!is(T : int)); +} + +enum a(T) = !is(T : int); diff --git a/tests/issue0116.d b/tests/issue0116.d new file mode 100644 index 0000000..7755f3f --- /dev/null +++ b/tests/issue0116.d @@ -0,0 +1,8 @@ +static assert(!is(T : int)); + +unittest +{ + foo(!is(T : int)); +} + +enum a(T) = !is(T : int); diff --git a/tests/otbs/issue0116.d.ref b/tests/otbs/issue0116.d.ref new file mode 100644 index 0000000..c8b6a99 --- /dev/null +++ b/tests/otbs/issue0116.d.ref @@ -0,0 +1,7 @@ +static assert(!is(T : int)); + +unittest { + foo(!is(T : int)); +} + +enum a(T) = !is(T : int);