Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tanishiking opened this issue Aug 13, 2021 · 0 comments
Open
Assignees

Comments

@tanishiking
Copy link
Member

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

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants