Skip to content

Conversation

@hamzaremmal
Copy link
Member

So far, we still have pattern matching warnings, init warnings, a bug in the deprecatedOverride logic that triggers warnings because of generated code and some CC warnings too.

@hamzaremmal hamzaremmal requested a review from a team as a code owner November 21, 2025 11:36
/** stringOf formatted for use in a repl result. */
def replStringOf(arg: Any, maxElements: Int): String =
stringOf(arg, maxElements) match {
case null => "null toString"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stringOf(null, maxElements) = "null", this is indeed not reachable.

Copy link
Contributor

@som-snytt som-snytt Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was for a non-null value for which toString returns null.

https://github.com/scala/scala/pull/6706/files

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, in this case, stringOf should return String | Null. I will remove that commit from this PR until we check what we will do in this case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch @som-snytt!

def next(): R =
if(!hasNext) Iterator.empty.next()
else node match {
else node.nn match {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the call to hasNext before makes sure that indeed node is not null. This was an exhaustivity warning (missing case null).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elidable was deprecated in #23913.

@hamzaremmal hamzaremmal merged commit 5e99614 into scala:main Nov 21, 2025
44 of 45 checks passed
@hamzaremmal hamzaremmal deleted the less-warnings branch November 21, 2025 12:47
hamzaremmal added a commit that referenced this pull request Nov 21, 2025
#24500 was on auto-merge and it failed because the positions were
changed. This PR fixes the positions while I also updated the branch
requirements for a PR to include all the jobs (excluding some of the
non-bootstrapped for now).
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