pekko icon indicating copy to clipboard operation
pekko copied to clipboard

chore: Switch to new new wildcard [?].

Open He-Pin opened this issue 1 year ago • 6 comments

Motivation: Test and migrate code to use ?.

known issue: https://github.com/VirtusLab/scala-cli/issues/2684

Note: this pr is for testing

background: https://github.com/apache/incubator-pekko/pull/878

[error] -- Error: /home/runner/work/incubator-pekko/incubator-pekko/actor/src/main/scala/org/apache/pekko/actor/TypedActor.scala:277:38 
[error] 277 |      interfaces: immutable.Seq[Class[_]])
[error]     |                                      ^
[error]     |`_` is deprecated for wildcard arguments of types: use `?` instead
[error]     |This construct can be rewritten automatically under -rewrite -source 3.4-migration.

He-Pin avatar Jan 17 '24 02:01 He-Pin

Will need another ignore blame, if this can get merged.

He-Pin avatar Jan 17 '24 06:01 He-Pin

So I am a bit on the fence of this, mainly because its such a massive rewrite that its going to cause quite a bit of chaos especially with the amount of open PR's we have. I would be more amicable to it if we only rewrote scala-3 sources rather than the entire project.

Another disadvantage is that it will make backports to 1.0.x slightly more complicated (I guess we can also apply this migration to the 1.0.x branch to solve this specific issue as its only syntax that doesn't have any other impact).

I am not against it, but there might be better timing to merge such a PR (i.e. when there are very few open PR's). Curious to hear what others think. Would also like to see the response from https://github.com/VirtusLab/scala-cli/issues/2684

mdedetrich avatar Jan 17 '24 06:01 mdedetrich

If I compile it with Scala 3.4, there will be many warning, I want our code prepare for the next LTS early, at least seems not that harm, and in Java we use <?> everyday.

He-Pin avatar Jan 17 '24 06:01 He-Pin

If I compile it with Scala 3.4, there will be many warning, I want our code prepare for the next LTS early, at least seems not that harm, and in Java we use <?> everyday.

Thanks for providing the context, then I would initially suggest lets wait until Pekko 1.1.0 is out and some more PR's are merged, Scala 3.5.x LTS is still a long way off.

mdedetrich avatar Jan 17 '24 07:01 mdedetrich

https://github.com/lampepfl/dotty/issues/19479

@mdedetrich another case why I want pekko code to be more scala 3.4 friendly

He-Pin avatar Jan 19 '24 04:01 He-Pin

@mdedetrich another case why I want pekko code to be more scala 3.4 friendly

This appears to be entirely unrelated and type inferencer/compiler bug, not syntax.

mdedetrich avatar Jan 19 '24 04:01 mdedetrich