Skip to content

[Scala3] Move BoringUtilsSpec#5389

Open
adkian-sifive wants to merge 1 commit into
mainfrom
adkian-sifive/scala3-boringutilsspec
Open

[Scala3] Move BoringUtilsSpec#5389
adkian-sifive wants to merge 1 commit into
mainfrom
adkian-sifive/scala3-boringutilsspec

Conversation

@adkian-sifive
Copy link
Copy Markdown
Member

Summary

Scala 3 widens the DUT type here to Module. Add explicit val dut: Type annotations so that .sources/.sinks members on Top stay visible under Scala 3's tighter override-val widening

Release Notes

Move BoringUtilsSpec to /src/test/scala/

@adkian-sifive adkian-sifive added the Scala 3 Changes related to upgrading to Scala 3 label May 28, 2026
@jackkoenig
Copy link
Copy Markdown
Contributor

Scala 3 widens the DUT type here to Module. Add explicit val dut: Type annotations so that .sources/.sinks members on Top stay visible under Scala 3's tighter override-val widening

This seems very problematic and I'm not convinced it's correct.

Welcome to Scala 3.3.7 (21.0.7, Java Java HotSpot(TM) 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> trait Animal
case // defined trait Animal

scala> case class Cat(name: String) extends Animal
// defined case class Cat

scala> def mkList[A <: Animal](as: A*): List[A] = List(as*)
def mkList[A <: Animal](as: A*): List[A]

scala> val xs = mkList(Cat("Bob"), Cat("Bill"))
val xs: List[Cat] = List(Cat(Bob), Cat(Bill))

How is Module.apply any different than my mkList?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scala 3 Changes related to upgrading to Scala 3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants