From 53a40b49cae38de691ef50876a461dd0d8d64b1e Mon Sep 17 00:00:00 2001 From: Jan Chyb <48855024+jchyb@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:18:11 +0200 Subject: [PATCH] Add regression test for i19675 (#21159) Originally fixed by #19926 Closes #19675 Even though this is a slower sbt scripted test, I think it's worth adding, since it showcases a different issue than what #19926 was fixing, and I do not believe it is reproducible in any way without a scala-2 dependency (so we cannot minimize it into regular compilation test). --- .../i19675/UnrelatedDeprecationWarning.scala | 22 +++++++++++++++++++ sbt-test/scala2-compat/i19675/build.sbt | 6 +++++ sbt-test/scala2-compat/i19675/test | 1 + 3 files changed, 29 insertions(+) create mode 100644 sbt-test/scala2-compat/i19675/UnrelatedDeprecationWarning.scala create mode 100644 sbt-test/scala2-compat/i19675/build.sbt create mode 100644 sbt-test/scala2-compat/i19675/test diff --git a/sbt-test/scala2-compat/i19675/UnrelatedDeprecationWarning.scala b/sbt-test/scala2-compat/i19675/UnrelatedDeprecationWarning.scala new file mode 100644 index 000000000000..da7585a5dab7 --- /dev/null +++ b/sbt-test/scala2-compat/i19675/UnrelatedDeprecationWarning.scala @@ -0,0 +1,22 @@ +import com.twitter.finagle.Thrift +import com.twitter.finagle.thrift.ThriftService +import scala.reflect.ClassTag + +class Minim { + trait Foo[A] + + object Foo { + inline def make[A]: Foo[A] = ??? + } + + final class Unrelated() + + object Unrelated { + val foo = Foo.make[Unrelated] + } + + object Main { + def foo[S <: ThriftService](using ClassTag[S]) = + Thrift.client.build[S]("asd") + } +} diff --git a/sbt-test/scala2-compat/i19675/build.sbt b/sbt-test/scala2-compat/i19675/build.sbt new file mode 100644 index 000000000000..819be2d87d58 --- /dev/null +++ b/sbt-test/scala2-compat/i19675/build.sbt @@ -0,0 +1,6 @@ +scalaVersion := sys.props("plugin.scalaVersion") + +scalacOptions ++= Seq("-Wunused:imports", "-deprecation", "-Werror") +libraryDependencies ++= Seq( + "com.twitter" %% "finagle-thrift" % "24.2.0" +).map(_.cross(CrossVersion.for3Use2_13)) diff --git a/sbt-test/scala2-compat/i19675/test b/sbt-test/scala2-compat/i19675/test new file mode 100644 index 000000000000..73a68203f3f1 --- /dev/null +++ b/sbt-test/scala2-compat/i19675/test @@ -0,0 +1 @@ +> compile \ No newline at end of file