Skip to content

[SemanticDB] Nested annotations are ignored in SemanticDB signatures #13291

Open
@tanishiking

Description

@tanishiking

See: #12885 (comment)

Nested annotations are ignored in SemanticDB signatures

Compiler version

7945794

Minimized example

type paramAlias = param
type paramRec = param @param
type AnnotatedType = Int @param
type AnnotatedType2 = Int @paramAlias
type AnnotatedType3 = Int @(param @param)
type AnnotatedType4 = Int @paramRec
diff --git a/tests/semanticdb/expect/InstrumentTyper.scala b/tests/semanticdb/expect/InstrumentTyper.scala
index eb63e65538..a9feaae974 100644
--- a/tests/semanticdb/expect/InstrumentTyper.scala
+++ b/tests/semanticdb/expect/InstrumentTyper.scala
@@ -23,4 +23,10 @@ class InstrumentTyper { self: AnyRef =>
   type AnnotatedType = Int @param
   def singletonType(x: Predef.type) = ???
   final val clazzOf = classOf[Option[Int]]
+  type paramAlias = param
+  type paramRec = param @param
+  type AnnotatedType = Int @param
+  type AnnotatedType2 = Int @paramAlias
+  type AnnotatedType3 = Int @(param @param)
+  type AnnotatedType4 = Int @paramRec
 }

Output

example/InstrumentTyper#paramAlias# => type paramAlias  = param
example/InstrumentTyper#paramRec# => type paramRec  = param @param
example/InstrumentTyper#AnnotatedType# => type AnnotatedType  = Int @param
example/InstrumentTyper#AnnotatedType2# => type AnnotatedType2  = Int @param
example/InstrumentTyper#AnnotatedType3# => type AnnotatedType3  = Int @param
example/InstrumentTyper#AnnotatedType4# => type AnnotatedType4  = Int @param

Though AnnotatedType3 and AnnotatedType4 is type AnnotatedType3 = Int @(param @param) and type AnnotatedType4 = Int @paramRec respectively, they down to @param in SemanticDB.

Expectation

example/InstrumentTyper#AnnotatedType3# => type AnnotatedType3  = Int @param @param
example/InstrumentTyper#AnnotatedType4# => type AnnotatedType4  = Int @param @param

?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions