Skip to content

Commit 298b2b4

Browse files
committed
implicit objects have correct props
1 parent dc1e127 commit 298b2b4

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,8 @@ class ExtractSemanticDB extends Phase with
342342
SymbolInformation.Kind.UNKNOWN_KIND
343343

344344
private def symbolProps(sym: Symbol, symkinds: Set[SymbolKind])(given Context): Int =
345+
if sym.is(ModuleClass)
346+
return symbolProps(sym.sourceModule, symkinds)
345347
var props = 0
346348
if sym.isPrimaryConstructor
347349
props |= SymbolInformation.Property.PRIMARY.value
@@ -353,9 +355,9 @@ class ExtractSemanticDB extends Phase with
353355
props |= SymbolInformation.Property.SEALED.value
354356
if sym.isOneOf(GivenOrImplicit)
355357
props |= SymbolInformation.Property.IMPLICIT.value
356-
if sym.is(Lazy)
358+
if sym.is(Lazy, butNot=Module)
357359
props |= SymbolInformation.Property.LAZY.value
358-
if sym.isAllOf(CaseClass) || sym.isAllOf(EnumCase)
360+
if sym.isAllOf(Case | Module) || sym.is(CaseClass) || sym.isAllOf(EnumCase)
359361
props |= SymbolInformation.Property.CASE.value
360362
if sym.is(Covariant)
361363
props |= SymbolInformation.Property.COVARIANT.value

tests/semanticdb/metac.expect

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,19 +1289,19 @@ a/b/Givens.Monoid#empty(). => abstract method empty
12891289
a/b/Givens.foo(). => method foo
12901290
a/b/Givens.foo().(A) => implicit param A
12911291
a/b/Givens.foo().[A] => typeparam A
1292-
a/b/Givens.given_Monoid_String. => final object given_Monoid_String
1292+
a/b/Givens.given_Monoid_String. => final implicit object given_Monoid_String
12931293
a/b/Givens.given_Monoid_String.combine(). => method combine
12941294
a/b/Givens.given_Monoid_String.combine().(x) => param x
12951295
a/b/Givens.given_Monoid_String.combine().(y) => param y
12961296
a/b/Givens.given_Monoid_String.empty(). => method empty
1297-
a/b/Givens.given_sayGoodbye_of_B. => final object given_sayGoodbye_of_B
1297+
a/b/Givens.given_sayGoodbye_of_B. => final implicit object given_sayGoodbye_of_B
12981298
a/b/Givens.given_sayGoodbye_of_B.sayGoodbye(). => method sayGoodbye
12991299
a/b/Givens.given_sayGoodbye_of_B.sayGoodbye().(any) => param any
13001300
a/b/Givens.given_sayGoodbye_of_B.sayGoodbye().[B] => typeparam B
13011301
a/b/Givens.given_sayGoodbye_of_B.saySoLong(). => method saySoLong
13021302
a/b/Givens.given_sayGoodbye_of_B.saySoLong().(any) => param any
13031303
a/b/Givens.given_sayGoodbye_of_B.saySoLong().[B] => typeparam B
1304-
a/b/Givens.given_sayHello_of_A. => final object given_sayHello_of_A
1304+
a/b/Givens.given_sayHello_of_A. => final implicit object given_sayHello_of_A
13051305
a/b/Givens.given_sayHello_of_A.sayHello(). => method sayHello
13061306
a/b/Givens.given_sayHello_of_A.sayHello().(any) => param any
13071307
a/b/Givens.given_sayHello_of_A.sayHello().[A] => typeparam A

0 commit comments

Comments
 (0)