Skip to content

Commit a82605f

Browse files
committed
Do not add wildcard symbol of existential type to symbol section
1 parent d9838df commit a82605f

File tree

2 files changed

+8
-20
lines changed

2 files changed

+8
-20
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,9 @@ class TypeOps:
368368
// signature: type_signature(..., lo = <Nothing>, hi = <T>)
369369
case bounds: TypeBounds =>
370370
val wildcardSym = WildcardTypeSymbol(sym, bounds)
371-
registerFakeSymbol(wildcardSym)
371+
// DO NOT register the wildcard symbol to symbol section here
372+
// since it's not a symbol definition
373+
// registerFakeSymbol(wildcardSym)
372374
val ssym = wildcardSym.symbolName
373375
(Some(wildcardSym), s.TypeRef(s.Type.Empty, ssym, Seq.empty))
374376
case other =>

tests/semanticdb/metac.expect

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Schema => SemanticDB v4
4848
Uri => Advanced.scala
4949
Text => empty
5050
Language => Scala
51-
Symbols => 49 entries
51+
Symbols => 46 entries
5252
Occurrences => 101 entries
5353

5454
Symbols:
@@ -74,7 +74,6 @@ advanced/Structural#s4().(a) => param a: Int
7474
advanced/Test. => final object Test extends Object { self: Test.type => +11 decls }
7575
advanced/Test.e. => val method e Wildcards
7676
advanced/Test.e1. => val method e1 List[_] forSome { type _ }
77-
advanced/Test.e1.[_] => type _
7877
advanced/Test.e1x. => val method e1x Any
7978
advanced/Test.s. => val method s Structural
8079
advanced/Test.s1. => val method s1 Object { abstract val method x Int }
@@ -86,9 +85,7 @@ advanced/Test.s3x. => val method s3x Int
8685
advanced/Wildcards# => class Wildcards extends Object { self: Wildcards => +3 decls }
8786
advanced/Wildcards#`<init>`(). => primary ctor <init> (): Wildcards
8887
advanced/Wildcards#e1(). => method e1 => List[_] forSome { type _ }
89-
advanced/Wildcards#e1().[_] => type _
9088
advanced/Wildcards#e2(). => method e2 => List[_] forSome { type _ <: Int }
91-
advanced/Wildcards#e2().[_] => type _ <: Int
9289
local0 => abstract val method x Int
9390
local1 => abstract val method x Int
9491
local2 => val method x Int
@@ -298,7 +295,7 @@ Schema => SemanticDB v4
298295
Uri => Anonymous.scala
299296
Text => empty
300297
Language => Scala
301-
Symbols => 15 entries
298+
Symbols => 14 entries
302299
Occurrences => 30 entries
303300

304301
Symbols:
@@ -314,7 +311,6 @@ example/Anonymous#m1(). => method m1 [typeparam T [type _ ]]: Nothing
314311
example/Anonymous#m1().[T] => typeparam T [type _ ]
315312
example/Anonymous#m1().[T][_] => type _
316313
example/Anonymous#m2(). => method m2 => Map[_, List[_] forSome { type _ }] forSome { type _ }
317-
example/Anonymous#m2().[_] => type _
318314
local0 => val local x: Function1[Int, Int]
319315
local1 => final class $anon extends Object with Foo { self: $anon => +1 decls }
320316

@@ -811,7 +807,7 @@ Schema => SemanticDB v4
811807
Uri => Enums.scala
812808
Text => empty
813809
Language => Scala
814-
Symbols => 187 entries
810+
Symbols => 181 entries
815811
Occurrences => 148 entries
816812

817813
Symbols:
@@ -890,7 +886,6 @@ _empty_/Enums.Maybe.Just.unapply().[A] => typeparam A
890886
_empty_/Enums.Maybe.None. => case val static enum method None Maybe[Nothing]
891887
_empty_/Enums.Maybe.fromOrdinal(). => method fromOrdinal (param ordinal: Int): Maybe[_] forSome { type _ }
892888
_empty_/Enums.Maybe.fromOrdinal().(ordinal) => param ordinal: Int
893-
_empty_/Enums.Maybe.fromOrdinal().[_] => type _
894889
_empty_/Enums.Planet# => abstract sealed enum class Planet extends Enum[Planet] with Enum { self: Planet => +6 decls }
895890
_empty_/Enums.Planet#G. => private[this] final val method G 6.673E-11
896891
_empty_/Enums.Planet#`<init>`(). => primary ctor <init> (param mass: Double, param radius: Double): Planet
@@ -942,17 +937,13 @@ _empty_/Enums.Tag#[A] => typeparam A
942937
_empty_/Enums.Tag#`<init>`(). => primary ctor <init> [typeparam A ](): Tag[A]
943938
_empty_/Enums.Tag. => final object Tag extends Object { self: Tag.type => +7 decls }
944939
_empty_/Enums.Tag.$values. => private[this] val method $values Array[Tag[_] forSome { type _ }]
945-
_empty_/Enums.Tag.$values.[_] => type _
946940
_empty_/Enums.Tag.BooleanTag. => case val static enum method BooleanTag Tag[Boolean]
947941
_empty_/Enums.Tag.IntTag. => case val static enum method IntTag Tag[Int]
948942
_empty_/Enums.Tag.fromOrdinal(). => method fromOrdinal (param ordinal: Int): Tag[_] forSome { type _ }
949943
_empty_/Enums.Tag.fromOrdinal().(ordinal) => param ordinal: Int
950-
_empty_/Enums.Tag.fromOrdinal().[_] => type _
951944
_empty_/Enums.Tag.valueOf(). => method valueOf (param $name: String): Tag[_] forSome { type _ >: Int & Boolean <: Int | Boolean }
952945
_empty_/Enums.Tag.valueOf().($name) => param $name: String
953-
_empty_/Enums.Tag.valueOf().[_] => type _ >: Int & Boolean <: Int | Boolean
954946
_empty_/Enums.Tag.values(). => method values => Array[Tag[_] forSome { type _ }]
955-
_empty_/Enums.Tag.values().[_] => type _
956947
_empty_/Enums.WeekDays# => abstract sealed enum class WeekDays extends Object with Enum { self: WeekDays => +1 decls }
957948
_empty_/Enums.WeekDays#`<init>`(). => primary ctor <init> (): WeekDays
958949
_empty_/Enums.WeekDays. => final object WeekDays extends Object { self: WeekDays.type => +13 decls }
@@ -994,7 +985,6 @@ _empty_/Enums.`<:<`.`given_<:<_T_T`(). => final implicit given method given_<:<_
994985
_empty_/Enums.`<:<`.`given_<:<_T_T`().[T] => typeparam T
995986
_empty_/Enums.`<:<`.fromOrdinal(). => method fromOrdinal (param ordinal: Int): <:<[_, _] forSome { type _ ; type _ }
996987
_empty_/Enums.`<:<`.fromOrdinal().(ordinal) => param ordinal: Int
997-
_empty_/Enums.`<:<`.fromOrdinal().[_] => type _
998988
_empty_/Enums.some1. => val method some1 Option[Int]
999989
_empty_/Enums.unwrap(). => method unwrap [typeparam A , typeparam B ](param opt: Option[A])(implicit given param ev: <:<[A, Option[B]]): Option[B]
1000990
_empty_/Enums.unwrap().(ev) => implicit given param ev: <:<[A, Option[B]]
@@ -3777,7 +3767,7 @@ Schema => SemanticDB v4
37773767
Uri => recursion.scala
37783768
Text => empty
37793769
Language => Scala
3780-
Symbols => 37 entries
3770+
Symbols => 36 entries
37813771
Occurrences => 45 entries
37823772

37833773
Symbols:
@@ -3788,7 +3778,6 @@ local3 => val local p: N$2
37883778
local4 => val local Nat_this: Zero.type
37893779
local5 => val local Nat_this: Succ[Zero.type]
37903780
local6 => val local Nat_this: Succ[_] forSome { type _ <: Succ[Zero.type] }
3791-
local6[_] => type _ <: Succ[Zero.type]
37923781
recursion/Nats. => final object Nats extends Object { self: Nats.type => +9 decls }
37933782
recursion/Nats.Nat# => sealed trait Nat extends Object { self: Nat => +3 decls }
37943783
recursion/Nats.Nat#`++`(). => inline transparent macro ++ => Succ[Nat.this.type]
@@ -4044,7 +4033,7 @@ Schema => SemanticDB v4
40444033
Uri => semanticdb-Types.scala
40454034
Text => empty
40464035
Language => Scala
4047-
Symbols => 147 entries
4036+
Symbols => 144 entries
40484037
Occurrences => 225 entries
40494038

40504039
Symbols:
@@ -4147,11 +4136,8 @@ types/Test.C#compoundType4. => val method compoundType4 Object
41474136
types/Test.C#compoundType5. => val method compoundType5 M & N
41484137
types/Test.C#compoundType6. => val method compoundType6 M & N
41494138
types/Test.C#existentialType2. => val method existentialType2 List[_] forSome { type _ }
4150-
types/Test.C#existentialType2.[_] => type _
41514139
types/Test.C#existentialType3. => val method existentialType3 Class[_] forSome { type _ }
4152-
types/Test.C#existentialType3.[_] => type _
41534140
types/Test.C#existentialType4. => val method existentialType4 Class[_] forSome { type _ }
4154-
types/Test.C#existentialType4.[_] => type _
41554141
types/Test.C#p. => val method p P
41564142
types/Test.C#singleType1. => val method singleType1 x.type
41574143
types/Test.C#singleType2. => val method singleType2 p.x.type

0 commit comments

Comments
 (0)