Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

xuwei-k
Copy link
Contributor

@xuwei-k xuwei-k commented Sep 11, 2025

Welcome to Scala 2.12.20 (OpenJDK 64-Bit Server VM, Java 21.0.8).
Type in expressions for evaluation. Or try :help.

scala> def a: Class[?] = null
a: Class[_]
Welcome to Scala 3.7.3 (21.0.8, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                             
scala> def a1: Class[_] = null
1 warning found
-- Warning: --------------------------------------------------------------------
1 |def a1: Class[_] = null
  |              ^
  |        `_` is deprecated for wildcard arguments of types: use `?` instead
def a1: Class[?]
                                                                                                                                             
scala> def a2: Class[?] = null
def a2: Class[?]

@sjrd
Copy link
Member

sjrd commented Sep 11, 2025

I ran the 'full' CI for this PR, in order to test all the Scala versions. It did pass. the sbt plugin is probably the only project that we only compile with 2.12.20, and not every 2.12.x that we support.

So we could take this. Is this the only thing required to make the sbt plugin build without warning under Scala 3, though? How much more of these changes do we expect?

@xuwei-k
Copy link
Contributor Author

xuwei-k commented Sep 11, 2025

Is this the only thing required to make the sbt plugin build without warning under Scala 3, though? How much more of these changes do we expect?

I think not only this changes. Can't actually know until I actually try it.

@sjrd
Copy link
Member

sjrd commented Sep 11, 2025

We should have a comprehensive view of what needs to be done before we start merging things like this. There's no point creating a mix of Scala 2 and 3 syntax in our repo if we don't manage to fully solve the issue.

Especially for warnings, there is always the alternative of ignoring warnings when compiling with Scala 3.

@ekrich
Copy link
Contributor

ekrich commented Sep 11, 2025

If the new syntax is supported with the 2.12.x versions that needs supporting, wouldn't it make sense to just make this change for the whole repo?

@sjrd
Copy link
Member

sjrd commented Sep 11, 2025

The rest of the repo still builds with 2.12.6, so no.

@ekrich
Copy link
Contributor

ekrich commented Sep 11, 2025

I guess I read the above incorrectly and I did not know the 2.12 version where the change got added.

@xuwei-k
Copy link
Contributor Author

xuwei-k commented Sep 11, 2025

scala/scala@6d2ca69

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.

3 participants