Skip to content

Commit

Permalink
Suppress additional warnings existing in the LTS due to rejection of #…
Browse files Browse the repository at this point in the history
…17548 backport
  • Loading branch information
WojciechMazur committed Jul 8, 2024
1 parent c2eb000 commit 7a6b83b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion community-build/community-projects/scodec
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,10 @@ object projects:

lazy val shapeless3 = SbtCommunityProject(
project = "shapeless-3",
sbtTestCommand = "testJVM; testJS",
sbtTestCommand = List(
"""set derivingJVM/scalacOptions += "-Wconf:msg=New anonymous class definition will be duplicated at each inline site:s" """,
"""set derivingJS/scalacOptions += "-Wconf:msg=New anonymous class definition will be duplicated at each inline site:s" """,
"testJVM", "testJS").mkString("; "),
sbtDocCommand = forceDoc("typeable", "deriving"),
scalacOptions = SbtCommunityProject.scalacOptions.filter(_ != "-Ysafe-init"), // due to -Xfatal-warnings
)
Expand Down
14 changes: 14 additions & 0 deletions tests/warn/i16723b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// LTS specifc, not applicable to Next thanks to #17548 improvements
trait Empty[T]:
def empty: T

object Empty:
inline def withOnly[F[_], R, T](f: [t <: T] => F[t] => R): R = f(null.asInstanceOf[F[T]])

def mkEmpty[T](t: T): Empty[T] = ???

inline given emptyGenC[A]: Empty[A] =
mkEmpty(withOnly[Empty, A, A]([a <: A] => (_: Empty[a]).empty)) // warn

@main def Test =
Empty.emptyGenC[String]

0 comments on commit 7a6b83b

Please sign in to comment.