Skip to content

Commit 883a6a1

Browse files
committed
Fix missing symbol occurrence for typebounds of type params
1 parent 5ffa445 commit 883a6a1

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,8 @@ class ExtractSemanticDB extends Phase:
177177
case PatternValDef(pat, rhs) =>
178178
traverse(rhs)
179179
PatternValDef.collectPats(pat).foreach(traverse)
180+
case tree: TypeDef =>
181+
traverseChildren(tree)
180182
case tree =>
181183
if !excludeChildren(tree.symbol) then
182184
traverseChildren(tree)

tests/semanticdb/expect/i9782.expect.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ trait Elem/*<-_empty_::Elem#*/[T/*<-_empty_::Elem#[T]*/ <: Txn/*->_empty_::Txn#*
66
trait Obj/*<-_empty_::Obj#*/[T/*<-_empty_::Obj#[T]*/ <: Txn/*->_empty_::Txn#*/[T/*->_empty_::Obj#[T]*/]] extends Elem/*->_empty_::Elem#*/[T/*->_empty_::Obj#[T]*/]
77

88
trait Copy/*<-_empty_::Copy#*/[In/*<-_empty_::Copy#[In]*/ <: Txn/*->_empty_::Txn#*/[In/*->_empty_::Copy#[In]*/], Out/*<-_empty_::Copy#[Out]*/ <: Txn/*->_empty_::Txn#*/[Out/*->_empty_::Copy#[Out]*/]] {
9-
def copyImpl/*<-_empty_::Copy#copyImpl().*/[Repr/*<-_empty_::Copy#copyImpl().[Repr]*/[~ <: Txn[~]] <: Elem[~]](in/*<-_empty_::Copy#copyImpl().(in)*/: Repr/*->_empty_::Copy#copyImpl().[Repr]*/[In/*->_empty_::Copy#[In]*/]): Repr/*->_empty_::Copy#copyImpl().[Repr]*/[Out/*->_empty_::Copy#[Out]*/]
9+
def copyImpl/*<-_empty_::Copy#copyImpl().*/[Repr/*<-_empty_::Copy#copyImpl().[Repr]*/[~/*<-_empty_::Copy#copyImpl().[Repr][`~`]*/ <: Txn/*->_empty_::Txn#*/[~/*->_empty_::Copy#copyImpl().[Repr][`~`]*/]] <: Elem/*->_empty_::Elem#*/[~/*->_empty_::Copy#copyImpl().[Repr][`~`]*/]](in/*<-_empty_::Copy#copyImpl().(in)*/: Repr/*->_empty_::Copy#copyImpl().[Repr]*/[In/*->_empty_::Copy#[In]*/]): Repr/*->_empty_::Copy#copyImpl().[Repr]*/[Out/*->_empty_::Copy#[Out]*/]
1010

11-
def apply/*<-_empty_::Copy#apply().*/[Repr/*<-_empty_::Copy#apply().[Repr]*/[~ <: Txn[~]] <: Elem[~]](in/*<-_empty_::Copy#apply().(in)*/: Repr/*->_empty_::Copy#apply().[Repr]*/[In/*->_empty_::Copy#[In]*/]): Repr/*->_empty_::Copy#apply().[Repr]*/[Out/*->_empty_::Copy#[Out]*/] = {
11+
def apply/*<-_empty_::Copy#apply().*/[Repr/*<-_empty_::Copy#apply().[Repr]*/[~/*<-_empty_::Copy#apply().[Repr][`~`]*/ <: Txn/*->_empty_::Txn#*/[~/*->_empty_::Copy#apply().[Repr][`~`]*/]] <: Elem/*->_empty_::Elem#*/[~/*->_empty_::Copy#apply().[Repr][`~`]*/]](in/*<-_empty_::Copy#apply().(in)*/: Repr/*->_empty_::Copy#apply().[Repr]*/[In/*->_empty_::Copy#[In]*/]): Repr/*->_empty_::Copy#apply().[Repr]*/[Out/*->_empty_::Copy#[Out]*/] = {
1212
val out/*<-local0*/ = copyImpl/*->_empty_::Copy#copyImpl().*/[Repr/*->_empty_::Copy#apply().[Repr]*/](in/*->_empty_::Copy#apply().(in)*/)
1313
(/*->scala::Tuple2.apply().*/in/*->_empty_::Copy#apply().(in)*/, out/*->local0*/) match {
1414
case (/*->scala::Tuple2.unapply().*/inObj/*<-local1*/: Obj/*->_empty_::Obj#*/[In/*->_empty_::Copy#[In]*/], outObj/*<-local2*/: Obj/*->_empty_::Obj#*/[Out/*->_empty_::Copy#[Out]*/]) => // problem here

tests/semanticdb/metac.expect

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3543,8 +3543,8 @@ Schema => SemanticDB v4
35433543
Uri => i9782.scala
35443544
Text => empty
35453545
Language => Scala
3546-
Symbols => 22 entries
3547-
Occurrences => 55 entries
3546+
Symbols => 24 entries
3547+
Occurrences => 65 entries
35483548

35493549
Symbols:
35503550
_empty_/Copy# => trait Copy
@@ -3554,9 +3554,11 @@ _empty_/Copy#`<init>`(). => primary ctor <init>
35543554
_empty_/Copy#apply(). => method apply
35553555
_empty_/Copy#apply().(in) => param in
35563556
_empty_/Copy#apply().[Repr] => typeparam Repr
3557+
_empty_/Copy#apply().[Repr][`~`] => typeparam ~
35573558
_empty_/Copy#copyImpl(). => abstract method copyImpl
35583559
_empty_/Copy#copyImpl().(in) => param in
35593560
_empty_/Copy#copyImpl().[Repr] => typeparam Repr
3561+
_empty_/Copy#copyImpl().[Repr][`~`] => typeparam ~
35603562
_empty_/Elem# => trait Elem
35613563
_empty_/Elem#[T] => typeparam T
35623564
_empty_/Elem#`<init>`(). => primary ctor <init>
@@ -3598,13 +3600,23 @@ Occurrences:
35983600
[7:37..7:40): Out -> _empty_/Copy#[Out]
35993601
[8:6..8:14): copyImpl <- _empty_/Copy#copyImpl().
36003602
[8:15..8:19): Repr <- _empty_/Copy#copyImpl().[Repr]
3603+
[8:20..8:21): ~ <- _empty_/Copy#copyImpl().[Repr][`~`]
3604+
[8:25..8:28): Txn -> _empty_/Txn#
3605+
[8:29..8:30): ~ -> _empty_/Copy#copyImpl().[Repr][`~`]
3606+
[8:36..8:40): Elem -> _empty_/Elem#
3607+
[8:41..8:42): ~ -> _empty_/Copy#copyImpl().[Repr][`~`]
36013608
[8:45..8:47): in <- _empty_/Copy#copyImpl().(in)
36023609
[8:49..8:53): Repr -> _empty_/Copy#copyImpl().[Repr]
36033610
[8:54..8:56): In -> _empty_/Copy#[In]
36043611
[8:60..8:64): Repr -> _empty_/Copy#copyImpl().[Repr]
36053612
[8:65..8:68): Out -> _empty_/Copy#[Out]
36063613
[10:6..10:11): apply <- _empty_/Copy#apply().
36073614
[10:12..10:16): Repr <- _empty_/Copy#apply().[Repr]
3615+
[10:17..10:18): ~ <- _empty_/Copy#apply().[Repr][`~`]
3616+
[10:22..10:25): Txn -> _empty_/Txn#
3617+
[10:26..10:27): ~ -> _empty_/Copy#apply().[Repr][`~`]
3618+
[10:33..10:37): Elem -> _empty_/Elem#
3619+
[10:38..10:39): ~ -> _empty_/Copy#apply().[Repr][`~`]
36083620
[10:42..10:44): in <- _empty_/Copy#apply().(in)
36093621
[10:46..10:50): Repr -> _empty_/Copy#apply().[Repr]
36103622
[10:51..10:53): In -> _empty_/Copy#[In]

0 commit comments

Comments
 (0)