Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warning when using TestPath implicits as shown in Doc #237

Closed
bwbecker opened this issue Mar 4, 2021 · 2 comments · Fixed by #309
Closed

Compiler warning when using TestPath implicits as shown in Doc #237

bwbecker opened this issue Mar 4, 2021 · 2 comments · Fixed by #309

Comments

@bwbecker
Copy link

bwbecker commented Mar 4, 2021

With scala 2.13.5 I'm getting compiler warnings when using the TestPath implicit. That's new after an update from scala 2.12.x.

[warn] /Users/bwbecker/oat/src/oatlibxp/oatlibxp/src/test/scala/oatLibXP/verify/ImplicitTest.scala:13:21: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): Implicit conversions from Array to immutable.IndexedSeq are implemented by copying; Use the more efficient non-copying ArraySeq.unsafeWrapArray or an explicit toIndexedSeq call
[warn]   val tests = Tests {
[warn]                     ^
[warn] /Users/bwbecker/oat/src/oatlibxp/oatlibxp/src/test/scala/oatLibXP/verify/ImplicitTest.scala:27:21: method copyArrayToImmutableIndexedSeq in class LowPriorityImplicits2 is deprecated (since 2.13.0): Implicit conversions from Array to immutable.IndexedSeq are implemented by copying; Use the more efficient non-copying ArraySeq.unsafeWrapArray or an explicit toIndexedSeq call
[warn]   val tests = Tests {
[warn]                     ^
[warn] two warnings found
--------- Running Tests oatLibXP.verify.{ImplicitTest1,ImplicitTest2} ---------
--------- Running Tests oatLibXP.verify.{ImplicitTest1,ImplicitTest2} ---------
+ oatLibXP.verify.ImplicitTest1.causes a compiler warning 3ms  
+ oatLibXP.verify.ImplicitTest2.causes a compiler warning 3ms  
[info] Tests: 2, Passed: 2, Failed: 0
[success] Total time: 1 s, completed Mar. 4, 2021, 2:14:26 p.m.

Here's the code:

package oatLibXP.verify

import utest._
import utest.framework.TestPath

object ImplicitTest1 extends TestSuite {

  def f(x: Int)(implicit testPath: TestPath): Unit = {
    testPath.value.mkString(" ") ==> "causes a compiler warning"
    x ==> 42
  }

  val tests = Tests {
    test("causes a compiler warning") {
      f(42)
    }
  }
}

object ImplicitTest2 extends TestSuite {

  def g(x: Int, testPath: TestPath): Unit = {
    testPath.value.mkString(" ") ==> "causes a compiler warning"
    x ==> 42
  }

  val tests = Tests {
    test("causes a compiler warning") {
      g(42, implicitly[TestPath])
    }
  }
}

Also, the TestPath section of the Docs uses the now deprecated "test description" - { ... } format.

@ekiwi
Copy link

ekiwi commented Jan 9, 2023

Is there any update on this issue? Any way to work around the warning?
I am trying to get chiseltest to compile without warnings and it looks like everyone who uses our utest based trait will get this warning when using Scala 2.13: https://github.com/ucb-bar/chiseltest/blob/129d82c952d18d9753e622ae3d9b5d53c79b059a/src/main/scala/chiseltest/ChiselUtestTester.scala#L77

@bwbecker
Copy link
Author

bwbecker commented Jan 9, 2023

I'm still getting the error, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants