Skip to content

Conversation

@ashawley
Copy link
Member

After updating the build to 2.12.0-M4 for JDK 1.8 and higher in #100, I noticed some new pattern match warnings in the build:

[warn] src/test/scala/scala/xml/PatternMatching.scala:93: match may not be exhaustive.
[warn] It would fail on the following inputs: ((_ : Serializable), "bar"), ((_ : Serializable), _), (Node(), "foo"), (Node(), _), (Object(), _), (_, "bar"), (_, "foo"), (_, String()), (_, _)
[warn]     assertTrue((body: AnyRef, "foo") match {
[warn]                ^
[warn] src/test/scala/scala/xml/PatternMatching.scala:98: match may not be exhaustive.
[warn] It would fail on the following inputs: ((_ : scala.xml.Node with Serializable), _), (_, "foo"), (_, _)
[warn]     assertTrue((body, "foo") match {
[warn]                ^
[warn] src/test/scala/scala/xml/PatternMatching.scala:103: match may not be exhaustive.
[warn] It would fail on the following inputs: ((_ : Serializable), _), (Node(), _), (Object(), _), (_, "foo"), (_, _)
[warn]     assertTrue((body: AnyRef, "foo") match {
[warn]                ^
[warn] src/test/scala/scala/xml/PatternMatching.scala:108: match may not be exhaustive.
[warn] It would fail on the following inputs: ((_ : Serializable), _), (Node(), _), (Object(), _), (_, "foo"), (_, _)
[warn]     assertTrue((body: AnyRef, "foo") match {
[warn]                ^
[warn] four warnings found

I added some wildcard case matches to silence the warnings, and it doesn't appear they broke the tests nor undermined their purpose.

@ashawley ashawley force-pushed the 2.12.0-M2-pattern-matching branch from e73f25d to c60da62 Compare September 14, 2016 14:08
@SethTisue
Copy link
Member

LGTM

	* src/test/scala/scala/xml/PatternMatching.scala (SI_4124): Add
	wildcard default case match to quiet warnings that appear with
	with Scala version 2.12.0-M4.
@ashawley ashawley force-pushed the 2.12.0-M2-pattern-matching branch from c60da62 to c975283 Compare September 20, 2016 22:07
@biswanaths biswanaths merged commit c975283 into scala:master Oct 17, 2016
@biswanaths
Copy link
Contributor

Merged. Thank you @ashawley and @SethTisue .

@ashawley ashawley deleted the 2.12.0-M2-pattern-matching branch May 11, 2017 19:43
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