From f113a30ad3b876b1f9812caf682f4e8f0246cb8b Mon Sep 17 00:00:00 2001 From: Albert Meltzer <7529386+kitbellew@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:19:39 -0800 Subject: [PATCH] Test redundant parens with infix type in `given` --- .../shared/src/test/resources/rewrite/RedundantParens.stat | 6 ++++++ .../shared/src/test/scala/org/scalafmt/FormatTests.scala | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scalafmt-tests/shared/src/test/resources/rewrite/RedundantParens.stat b/scalafmt-tests/shared/src/test/resources/rewrite/RedundantParens.stat index 289ed9569..610d9b108 100644 --- a/scalafmt-tests/shared/src/test/resources/rewrite/RedundantParens.stat +++ b/scalafmt-tests/shared/src/test/resources/rewrite/RedundantParens.stat @@ -1787,3 +1787,9 @@ object a { ) } } +<<< #4645 +runner.dialect = scala3 +=== +given fooBar: (Foo & Bar) = new Foo with Bar {} +>>> +given fooBar: Foo & Bar = new Foo with Bar {} diff --git a/scalafmt-tests/shared/src/test/scala/org/scalafmt/FormatTests.scala b/scalafmt-tests/shared/src/test/scala/org/scalafmt/FormatTests.scala index bc53b08d0..ce2698476 100644 --- a/scalafmt-tests/shared/src/test/scala/org/scalafmt/FormatTests.scala +++ b/scalafmt-tests/shared/src/test/scala/org/scalafmt/FormatTests.scala @@ -144,7 +144,7 @@ class FormatTests extends FunSuite with CanRunTests with FormatAssertions { val explored = Debug.explored.get() logger.debug(s"Total explored: $explored") if (!onlyUnit && !onlyManual) - assertEquals(explored, 1208516, "total explored") + assertEquals(explored, 1208548, "total explored") val results = debugResults.result() // TODO(olafur) don't block printing out test results. // I don't want to deal with scalaz's Tasks :'(