Skip to content

SemanticDB does not include symbol occurrence of constructor #18319

Closed
@swachter

Description

@swachter

Compiler version

3.3.0

Minimized code

case class Test(i: Int)

Output

The semanticdb file contains no symbol occurrence for the constructor when compiled under Scala 3.3.0. When compiled under Scala 2.13.11 and using the semanticdb-scalac plugin a symbol occurrence is included for the constructor.

Output of the metap utility (cf. semanticdb-guide):

Semanticdb file produced by Scala 3.3.0:

src/main/scala/simple/Test.scala
--------------------------------

Summary:
Schema => SemanticDB v4
Uri => src/main/scala/simple/Test.scala
Text => non-empty
Language => Scala
Symbols => 14 entries
Occurrences => 3 entries

Symbols:
_empty_/Test# => case class Test extends Object with Product with Serializable { self: Test => +5 decls }
_empty_/Test#_1(). => method _1=> Int
_empty_/Test#`<init>`(). => primary ctor <init>(val i: Int): Test
_empty_/Test#`<init>`().(i) => val param i: Int
_empty_/Test#copy$default$1(). => method copy$default$1=> Int @uncheckedVariance
_empty_/Test#copy(). => method copy(i: Int): Test
_empty_/Test#copy().(i) => param i: Int
_empty_/Test#i. => val method iInt
_empty_/Test. => final object Test extends Object { self: Test.type => +4 decls }
_empty_/Test.apply(). => method apply(i: Int): Test
_empty_/Test.apply().(i) => param i: Int
_empty_/Test.toString(). => method toString=> String <: scala/Any#toString().
_empty_/Test.unapply(). => method unapply(x$1: Test): Test
_empty_/Test.unapply().(x$1) => param x$1: Test

Occurrences:
[0:11..0:15): Test <= _empty_/Test#
[0:16..0:17): i <= _empty_/Test#i.
[0:19..0:22): Int => scala/Int#

Semanticdb file produced by semanticdb-scalac plugin under Scala 2.13.11:

src/main/scala/simple/Test.scala
--------------------------------

Summary:
Schema => SemanticDB v4
Uri => src/main/scala/simple/Test.scala
Text => non-empty
Language => Scala
Symbols => 29 entries
Occurrences => 4 entries

Symbols:
_empty_/Test# => case class Test extends AnyRef with Product with Serializable { +13 decls }
_empty_/Test#`<init>`(). => primary ctor <init>(val i: Int)
_empty_/Test#`<init>`().(i) => val param i: Int
_empty_/Test#canEqual(). => method canEqual(x$1: Any): Boolean <: scala/Equals#canEqual().
_empty_/Test#canEqual().(x$1) => param x$1: Any
_empty_/Test#copy$default$1(). => method copy$default$1: Int @uncheckedVariance
_empty_/Test#copy(). => method copy(i: Int): Test
_empty_/Test#copy().(i) => default param i: Int
_empty_/Test#equals(). => method equals(x$1: Any): Boolean <: scala/Equals#equals()., java/lang/Object#equals()., scala/Any#equals().
_empty_/Test#equals().(x$1) => param x$1: Any
_empty_/Test#hashCode(). => method hashCode(): Int <: java/lang/Object#hashCode()., scala/Any#hashCode().
_empty_/Test#i. => val method i: Int
_empty_/Test#productArity(). => method productArity: Int <: scala/Product#productArity().
_empty_/Test#productElement(). => method productElement(x$1: Int): Any <: scala/Product#productElement().
_empty_/Test#productElement().(x$1) => param x$1: Int
_empty_/Test#productElementName(). => method productElementName(x$1: Int): String <: scala/Product#productElementName().
_empty_/Test#productElementName().(x$1) => param x$1: Int
_empty_/Test#productIterator(). => method productIterator: Iterator[Any] <: scala/Product#productIterator().
_empty_/Test#productPrefix(). => method productPrefix: String <: scala/Product#productPrefix().
_empty_/Test#toString(). => method toString(): String <: java/lang/Object#toString()., scala/Any#toString().
_empty_/Test. => final object Test extends AbstractFunction1[Int, Test] with Serializable { +4 decls }
_empty_/Test.apply(). => method apply(i: Int): Test <: scala/Function1#apply().
_empty_/Test.apply().(i) => param i: Int
_empty_/Test.toString(). => final method toString(): String <: scala/Function1#toString()., java/lang/Object#toString()., scala/Any#toString().
_empty_/Test.unapply(). => method unapply(x$0: Test): Option[Int]
_empty_/Test.unapply().(x$0) => param x$0: Test
_empty_/Test.writeReplace(). => private method writeReplace(): Object
local0 => var local acc: Int
local1 => val local Test$1: Test

Occurrences:
[0:11..0:15): Test <= _empty_/Test#
[0:15..0:15):  <= _empty_/Test#`<init>`().
[0:16..0:17): i <= _empty_/Test#i.
[0:19..0:22): Int => scala/Int#

Expectation

The symbol occurrence for the constructor should be present.

[0:15..0:15):  <= _empty_/Test#`<init>`().

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions