Skip to content

Commit 7a6b83b

Browse files
committed
Suppress additional warnings existing in the LTS due to rejection of #17548 backport
1 parent c2eb000 commit 7a6b83b

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

community-build/src/scala/dotty/communitybuild/projects.scala

+4-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ object projects:
368368

369369
lazy val shapeless3 = SbtCommunityProject(
370370
project = "shapeless-3",
371-
sbtTestCommand = "testJVM; testJS",
371+
sbtTestCommand = List(
372+
"""set derivingJVM/scalacOptions += "-Wconf:msg=New anonymous class definition will be duplicated at each inline site:s" """,
373+
"""set derivingJS/scalacOptions += "-Wconf:msg=New anonymous class definition will be duplicated at each inline site:s" """,
374+
"testJVM", "testJS").mkString("; "),
372375
sbtDocCommand = forceDoc("typeable", "deriving"),
373376
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"), // due to -Xfatal-warnings
374377
)

tests/warn/i16723b.scala

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// LTS specifc, not applicable to Next thanks to #17548 improvements
2+
trait Empty[T]:
3+
def empty: T
4+
5+
object Empty:
6+
inline def withOnly[F[_], R, T](f: [t <: T] => F[t] => R): R = f(null.asInstanceOf[F[T]])
7+
8+
def mkEmpty[T](t: T): Empty[T] = ???
9+
10+
inline given emptyGenC[A]: Empty[A] =
11+
mkEmpty(withOnly[Empty, A, A]([a <: A] => (_: Empty[a]).empty)) // warn
12+
13+
@main def Test =
14+
Empty.emptyGenC[String]

0 commit comments

Comments
 (0)