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

Rename ParseResult to ParseBlockResult to avoid shadowing a nested class of a parent class #25374

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

ioannakok
Copy link
Contributor

@ioannakok ioannakok commented Aug 11, 2022

In Scala 2.13, we see this compilation error: "shadowing a nested class of a parent is deprecated but trait ParseResult shadows class ParseResult defined in trait Parsers; rename the class to something else"

[error] /Users/roberto/guardian/frontend/article/app/model/ParseBlockId.scala:10:16: shadowing a nested class of a parent is deprecated but trait ParseResult shadows class ParseResult defined in trait Parsers; rename the class to something else
[error]   sealed trait ParseResult { def toOption: Option[String] }
[error]                ^

ParseBlockId extends RegexParsers, which itself extends scala.util.parsing.combinator.Parsers, a class that has a nested class called ParseResult inside it! So we don't want to have a new nested class called ParseResult inside ParseBlockId - best to rename it.

@rtyley rtyley changed the title Rename ParseResult to ParseBlockResult Rename ParseResult to ParseBlockResult to avoid shadowing a nested class of a parent class Aug 11, 2022
@rtyley rtyley marked this pull request as ready for review August 11, 2022 16:30
@rtyley rtyley requested a review from a team as a code owner August 11, 2022 16:30
@ioannakok ioannakok requested a review from rtyley August 12, 2022 09:56
Copy link
Contributor

@OllysCoding OllysCoding left a comment

Choose a reason for hiding this comment

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

+1 LGTM

@ioannakok ioannakok merged commit 3057ca1 into main Aug 12, 2022
@ioannakok ioannakok deleted the scala-2.13/rename-parse-block branch August 12, 2022 11:55
@prout-bot
Copy link
Collaborator

Seen on PROD (merged by @ioannakok 11 minutes and 47 seconds ago)

@ioannakok ioannakok mentioned this pull request Aug 12, 2022
2 tasks
@rtyley rtyley added the Scala 2.13 See https://github.com/guardian/maintaining-scala-projects/issues/2 label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scala 2.13 See https://github.com/guardian/maintaining-scala-projects/issues/2 Seen-on-PROD
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants