diff --git a/src/dfmt/formatter.d b/src/dfmt/formatter.d index 317528eb..3de427aa 100644 --- a/src/dfmt/formatter.d +++ b/src/dfmt/formatter.d @@ -1269,7 +1269,7 @@ const pure @safe @nogc: break; if (depths[i] < d) break; - if (!braces && tokens[i].type == tok!";") + if (!braces && (tokens[i].type == tok!";" || tokens[i].type == tok!"{")) break; i++; } diff --git a/tests/allman/issue0153.d.ref b/tests/allman/issue0153.d.ref index c9ac2df9..64b99c19 100644 --- a/tests/allman/issue0153.d.ref +++ b/tests/allman/issue0153.d.ref @@ -1,5 +1,4 @@ -class Foo(T) : FirstInterfaceWithVeryLongName, - SecondInterfaceWithVeryLongName if (is(T : Bar)) +class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar)) { void foo() { diff --git a/tests/allman/issue0172.d.ref b/tests/allman/issue0172.d.ref new file mode 100644 index 00000000..e4608ade --- /dev/null +++ b/tests/allman/issue0172.d.ref @@ -0,0 +1,7 @@ +final class FormatVisitor : ASTVisitor +{ + this(ASTInformation* astInformation) + { + this.astInformation = astInformation; + } +} diff --git a/tests/issue0172.d b/tests/issue0172.d new file mode 100644 index 00000000..9e0772e1 --- /dev/null +++ b/tests/issue0172.d @@ -0,0 +1,7 @@ +final class FormatVisitor : ASTVisitor +{ + this(ASTInformation* astInformation) + { + this.astInformation = astInformation; + } +} diff --git a/tests/otbs/issue0153.d.ref b/tests/otbs/issue0153.d.ref index 51e2cd29..f55efed3 100644 --- a/tests/otbs/issue0153.d.ref +++ b/tests/otbs/issue0153.d.ref @@ -1,5 +1,4 @@ -class Foo(T) : FirstInterfaceWithVeryLongName, - SecondInterfaceWithVeryLongName if (is(T : Bar)) { +class Foo(T) : FirstInterfaceWithVeryLongName, SecondInterfaceWithVeryLongName if (is(T : Bar)) { void foo() { } } diff --git a/tests/otbs/issue0172.d.ref b/tests/otbs/issue0172.d.ref new file mode 100644 index 00000000..80021553 --- /dev/null +++ b/tests/otbs/issue0172.d.ref @@ -0,0 +1,5 @@ +final class FormatVisitor : ASTVisitor { + this(ASTInformation* astInformation) { + this.astInformation = astInformation; + } +}