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

Scala 2.13.9 with -Wnonunit-statement and xml literals result in false positives #12658

Open
SimY4 opened this issue Sep 29, 2022 · 3 comments
Open
Assignees
Labels
Milestone

Comments

@SimY4
Copy link

SimY4 commented Sep 29, 2022

Reproduction steps

Scala version: 2.13.9

class C {
  val xml = <xml><elem></elem></xml>
  
  def some = xml
}

Problem

Warning produced on line 2:
unused value of type scala.xml.NodeBuffer (add : Unit to discard silently)

Expected: the code compiles without warning.

@SethTisue
Copy link
Member

good catch, thanks! @som-snytt will likely want to take a look

@SethTisue SethTisue added this to the 2.13.10 milestone Sep 29, 2022
@SethTisue SethTisue added the lint label Sep 29, 2022
@som-snytt
Copy link

Thanks, I'll take a look. My umbrella ticket is #12653, but I'll follow up here.

I would not have thought to check XML -- in case there is another ticket for "things we never compile when we compile the compiler."

@som-snytt som-snytt self-assigned this Sep 29, 2022
@SethTisue SethTisue modified the milestones: 2.13.10, 2.13.11 Oct 8, 2022
@SethTisue
Copy link
Member

@som-snytt I'm putting this on Backlog, but feel free to try to fix it for 2.13.11 anyway, if you're so inclined :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants