-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
This is related to VirtusLab/besom#430.
This issue is really mind-bending: in repro in Besom repo I have this working fine if object exporting these implicit methods is in test scope but failing steadily if it's in main scope. Running scala-cli test . in this repro shows the same behavior: in main crashes while in test and local both work. If you do however run tests from metals in main and in test tests fail but local works!
Compiler version
3.3.1
Minimized code
https://github.com/lbialy/besom-issue-430
Output
Run scala-cli test . in the main folder of this repo and you will get:
repro.Suite:
==> X repro.Suite.in main 0.006s java.lang.ClassCastException: class scala.collection.immutable.$colon$colon cannot be cast to class scala.collection.View (scala.collection.immutable.$colon$colon and scala.collection.View are in unnamed module of loader 'app')
at scala.collection.BuildFrom$$anon$8.fromSpecific(BuildFrom.scala:85)
at repro.Output$.sequence(output.scala:20)
at repro.OutputExtensionsFactory$OutputSequenceOps.sequence(output.scala:26)
at repro.OutputExtensionsFactory$OutputTraverseOps.traverse(output.scala:30)
at repro.Suite.$init$$$anonfun$1(suite.test.scala:19)
+ in test 0.001s
+ local 0.001s
Expectation
I would expect that Array("a", "b").toList.traverse(str => ...) would infer CC type param in traverse as List and not View:

toList infers List[File]:

but then traverse infers Output[View[X]]:

He-Pin