Skip to content

Commit 5a108df

Browse files
committed
Fix missing symbol occurrence for typebounds of type params
1 parent dd358f9 commit 5a108df

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ class ExtractSemanticDB extends Phase:
163163
case PatternValDef(pat, rhs) =>
164164
traverse(rhs)
165165
PatternValDef.collectPats(pat).foreach(traverse)
166+
case tree: TypeDef =>
167+
traverseChildren(tree)
166168
case tree =>
167169
if !excludeChildren(tree.symbol) then
168170
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
(in/*->_empty_::Copy#apply().(in)*/, out/*->local0*/) match {
1414
case (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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3598,7 +3598,7 @@ Uri => i9782.scala
35983598
Text => empty
35993599
Language => Scala
36003600
Symbols => 24 entries
3601-
Occurrences => 49 entries
3601+
Occurrences => 59 entries
36023602

36033603
Symbols:
36043604
_empty_/Copy# => trait Copy [typeparam In <: Txn[In], typeparam Out <: Txn[Out]] extends Object { self: Copy[In, Out] => +5 decls }
@@ -3650,13 +3650,23 @@ Occurrences:
36503650
[7:37..7:40): Out -> _empty_/Copy#[Out]
36513651
[8:6..8:14): copyImpl <- _empty_/Copy#copyImpl().
36523652
[8:15..8:19): Repr <- _empty_/Copy#copyImpl().[Repr]
3653+
[8:20..8:21): ~ <- _empty_/Copy#copyImpl().[Repr][`~`]
3654+
[8:25..8:28): Txn -> _empty_/Txn#
3655+
[8:29..8:30): ~ -> _empty_/Copy#copyImpl().[Repr][`~`]
3656+
[8:36..8:40): Elem -> _empty_/Elem#
3657+
[8:41..8:42): ~ -> _empty_/Copy#copyImpl().[Repr][`~`]
36533658
[8:45..8:47): in <- _empty_/Copy#copyImpl().(in)
36543659
[8:49..8:53): Repr -> _empty_/Copy#copyImpl().[Repr]
36553660
[8:54..8:56): In -> _empty_/Copy#[In]
36563661
[8:60..8:64): Repr -> _empty_/Copy#copyImpl().[Repr]
36573662
[8:65..8:68): Out -> _empty_/Copy#[Out]
36583663
[10:6..10:11): apply <- _empty_/Copy#apply().
36593664
[10:12..10:16): Repr <- _empty_/Copy#apply().[Repr]
3665+
[10:17..10:18): ~ <- _empty_/Copy#apply().[Repr][`~`]
3666+
[10:22..10:25): Txn -> _empty_/Txn#
3667+
[10:26..10:27): ~ -> _empty_/Copy#apply().[Repr][`~`]
3668+
[10:33..10:37): Elem -> _empty_/Elem#
3669+
[10:38..10:39): ~ -> _empty_/Copy#apply().[Repr][`~`]
36603670
[10:42..10:44): in <- _empty_/Copy#apply().(in)
36613671
[10:46..10:50): Repr -> _empty_/Copy#apply().[Repr]
36623672
[10:51..10:53): In -> _empty_/Copy#[In]

0 commit comments

Comments
 (0)