From a8a44a843591de87598319126f4bc317550cb409 Mon Sep 17 00:00:00 2001 From: friendseeker <66892505+Friendseeker@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:34:51 -0800 Subject: [PATCH] Add pending scripted test for zinc#616 Further minimize Fix comment --- .../default-namespace-implicit/Baz.scala | 3 +++ .../default-namespace-implicit/Foo.scala | 8 ++++++++ .../default-namespace-implicit/changes/Foo.scala | 11 +++++++++++ .../default-namespace-implicit/package.scala | 5 +++++ .../default-namespace-implicit/pending | 7 +++++++ 5 files changed, 34 insertions(+) create mode 100644 zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Baz.scala create mode 100644 zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Foo.scala create mode 100644 zinc/src/sbt-test/source-dependencies/default-namespace-implicit/changes/Foo.scala create mode 100644 zinc/src/sbt-test/source-dependencies/default-namespace-implicit/package.scala create mode 100644 zinc/src/sbt-test/source-dependencies/default-namespace-implicit/pending diff --git a/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Baz.scala b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Baz.scala new file mode 100644 index 000000000..afaeccb41 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Baz.scala @@ -0,0 +1,3 @@ +package sbt.zinc.example + +case class Baz(value: Int) diff --git a/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Foo.scala b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Foo.scala new file mode 100644 index 000000000..457fbc306 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/Foo.scala @@ -0,0 +1,8 @@ +import sbt.zinc.example.Baz +// Adding the below import to changes/Foo.scala and Foo.scala make issue go away +// import `package`.b +class Foo(implicit baz: Baz) + +object Foo { + val f = new Foo +} diff --git a/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/changes/Foo.scala b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/changes/Foo.scala new file mode 100644 index 000000000..ee0ce234b --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/changes/Foo.scala @@ -0,0 +1,11 @@ +import sbt.zinc.example.Baz +// Adding the below import to changes/Foo.scala and Foo.scala make issue go away +// import `package`.b +class Foo(implicit baz: Baz) + +object Foo { + val f = new Foo +} + + +// Random Placeholder comment to let Zinc detect that Foo has changed \ No newline at end of file diff --git a/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/package.scala b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/package.scala new file mode 100644 index 000000000..528ee3a2e --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/package.scala @@ -0,0 +1,5 @@ +import sbt.zinc.example.Baz + +object `package` { + implicit val b = Baz(55) +} diff --git a/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/pending b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/pending new file mode 100644 index 000000000..4c2eeba2d --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/default-namespace-implicit/pending @@ -0,0 +1,7 @@ +> compile + +# Signal to Zinc that Foo is changed, such that it will be recompiled next +$ copy-file changes/Foo.scala Foo.scala + +# fails with: `could not find implicit value for parameter baz: sbt.zinc.example.Baz` +> compile