Skip to content

Conversation

@som-snytt
Copy link
Contributor

Witness equality checks introduced by patmat.
Must rewind when reporting, in particular contextual params became context functions and broke test for marker traits.

Fixes #25100


i match {
case i: Foo => println("i is a Foo")
case Bar => println("i is a Long")

Choose a reason for hiding this comment

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

This string is incorrect. I updated the match condition but forgot to update the string when I made the issue 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a fine tradition of not altering the pristine example from the ticket!

@som-snytt som-snytt marked this pull request as draft January 27, 2026 13:22
Witness equality checks introduced by patmat.
Must rewind when reporting, in particular contextual params
became context functions and broke test for marker traits.
@som-snytt
Copy link
Contributor Author

som-snytt commented Jan 27, 2026

SemanticDB specifically has a second phase to pick up diagnostics, so it must also move.

One diagnostic has gone missing. My impression that semanticdb (about which I know nothing) is just a hassle for testing is due to this experience. It's a big opaque file. Usually I just shrug and commit.

diff --git a/tests/semanticdb/metac.expect b/tests/semanticdb/metac.expect
index 76ad77ba87..4cc400d526 100644
--- a/tests/semanticdb/metac.expect
+++ b/tests/semanticdb/metac.expect
@@ -5366,7 +5366,7 @@ Text => empty
 Language => Scala
 Symbols => 50 entries
 Occurrences => 78 entries
-Diagnostics => 6 entries
+Diagnostics => 5 entries
 Synthetics => 2 entries

 Symbols:
@@ -5507,7 +5507,6 @@ Diagnostics:
 [9:42..9:43): [warning] unused explicit parameter
 [21:11..21:12): [warning] unused explicit parameter
 [24:24..24:27): [warning] unused pattern variable
-[25:27..25:28): [warning] unused pattern variable

 Synthetics:
 [23:6..23:10):List => *.unapplySeq[Nothing]

Probably it is the t which after patmat looks like it is used.

case val x6: List[t] @t = x5.$asInstanceOf[List[t] @t]

in source

??? match { case _: List[t] => ??? }

There was no test (!) so I added the "regular" test, as a TODO.

@som-snytt som-snytt force-pushed the issue/25100-unused-canequal branch from 94d0881 to 35b79fa Compare January 27, 2026 17:07
@som-snytt som-snytt marked this pull request as ready for review January 27, 2026 19:07
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.

Falsely declaring import as unused

2 participants