Closed rochala closed 1 week ago
I made a mistake when I reported this issue. I should have pointed out the more precise issue:
//> using scala 3.5.0-RC1-bin-SNAPSHOT
//> using option -Xprint:typer
object T:
def enrichedCompilerCompletions() =
val compilerCompletions: Seq[String] = ???
compilerCompletions
.toList
.flatMap(toCompletionValues)
.filterInteresting()
def toCompletionValues(x: String): List[String] = ???
extension (l: List[String])
def filterInteresting(qualType: String = ""): List[String] = ???
Actual issue is present for toCompletionValues
, which occurrence is not logged.
The current semanticdb output is:
Occurrences:
[3:7..3:8) <= _empty_/T.
[4:6..4:33) <= _empty_/T.enrichedCompilerCompletions().
[5:8..5:27) <= local0
[5:29..5:32) => scala/package.Seq#
[5:33..5:39) => scala/Predef.String#
[5:43..5:46) => scala/Predef.`???`().
// MISSING CASE HERE [9:16..9:33) => _empty_/T.toCompletionValues().
[10:7..10:24) => _empty_/T.filterInteresting().
[13:6..13:24) <= _empty_/T.toCompletionValues().
[13:25..13:26) <= _empty_/T.toCompletionValues().(x)
[13:28..13:34) => scala/Predef.String#
[13:37..13:41) => scala/package.List#
[13:42..13:48) => scala/Predef.String#
[13:52..13:55) => scala/Predef.`???`().
[15:13..15:14) <= _empty_/T.filterInteresting$default$2().(l)
[15:13..15:14) <= _empty_/T.filterInteresting().(l)
[15:16..15:20) => scala/package.List#
[15:21..15:27) => scala/Predef.String#
[16:8..16:25) <= _empty_/T.filterInteresting().
[16:26..16:34) <= _empty_/T.filterInteresting().(qualType)
[16:36..16:42) => scala/Predef.String#
[16:50..16:54) => scala/package.List#
[16:55..16:61) => scala/Predef.String#
[16:65..16:68) => scala/Predef.`???`().
The real problem is connected to the reported one, and is caused by lifting done in extension method application.
Compiler version
3.4.0
Minimized code
Semanticdb does not include occurences in lifted args. It can affect also other scenarios, but this one is a nice minimisation.
Output
With semanticdb:
Expectation
Semanticdb should properly find occurences for
val l$1: List[String]#350 = compilerCompletions#52.toList#54#352
after lifting.