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

chore: Switch to new new wildcard [?]. #971

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

He-Pin
Copy link
Member

@He-Pin He-Pin commented Jan 17, 2024

Motivation:
Test and migrate code to use ?.

known issue: VirtusLab/scala-cli#2684

Note: this pr is for testing

background: #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 He-Pin marked this pull request as draft January 17, 2024 02:46
.scalafmt.conf Outdated Show resolved Hide resolved
.scalafmt.conf Outdated Show resolved Hide resolved
.scalafmt.conf Outdated Show resolved Hide resolved
@He-Pin He-Pin marked this pull request as ready for review January 17, 2024 06:40
@He-Pin
Copy link
Member Author

He-Pin commented Jan 17, 2024

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

@mdedetrich
Copy link
Contributor

mdedetrich commented Jan 17, 2024

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 VirtusLab/scala-cli#2684

@He-Pin He-Pin changed the title Draft: Migrate to new wildcard ?. chore: Switch to new new wildcard [?]. Jan 17, 2024
@He-Pin
Copy link
Member Author

He-Pin commented Jan 17, 2024

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.

@mdedetrich
Copy link
Contributor

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.

@He-Pin
Copy link
Member Author

He-Pin commented Jan 19, 2024

scala/scala3#19479

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

@mdedetrich
Copy link
Contributor

@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.

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 this pull request may close these issues.

None yet

2 participants