Skip to content

Missing TypeApply synthetics when the arg is defined in the same file #24498

@eejbyfeldt

Description

@eejbyfeldt

Compiler version

3.7.4

Minimized code

$ cat missing_synthetics.scala
object test {
  def f[T](c: Int => T) = ???
  case class A(a: Int)
  f(A.apply)
}

Output

$ scalac missing_synthetics.scala -Xsemanticdb -semanticdb-target db
$ metap db/META-INF/semanticdb/missing_synthetics.scala.semanticdb 
missing_synthetics.scala
------------------------

Summary:
Schema => SemanticDB v4
Uri => missing_synthetics.scala
Text => empty
Language => Scala
Symbols => 19 entries
Occurrences => 14 entries

Symbols:
_empty_/test. => final object test extends Object { self: test.type => +5 decls }
_empty_/test.A# => case class A extends Object with Product with Serializable { self: A => +5 decls }
_empty_/test.A#_1(). => method _1=> Int
_empty_/test.A#`<init>`(). => primary ctor <init>(val a: Int): A
_empty_/test.A#`<init>`().(a) => val param a: Int
_empty_/test.A#a. => val method aInt
_empty_/test.A#copy$default$1(). => method copy$default$1=> Int @uncheckedVariance
_empty_/test.A#copy(). => method copy(a: Int): A
_empty_/test.A#copy().(a) => param a: Int
_empty_/test.A. => final object A extends Object { self: A.type => +4 decls }
_empty_/test.A.apply(). => method apply(a: Int): A
_empty_/test.A.apply().(a) => param a: Int
_empty_/test.A.toString(). => method toString=> String <: scala/Any#toString().
_empty_/test.A.unapply(). => method unapply(x$1: A): A
_empty_/test.A.unapply().(x$1) => param x$1: A
_empty_/test.f(). => method f[T](c: Function1[Int, T]): Nothing
_empty_/test.f().(c) => param c: Function1[Int, T]
_empty_/test.f().[T] => typeparam T
local0 => param a: Int

Occurrences:
[0:7..0:11) <= _empty_/test.
[1:6..1:7) <= _empty_/test.f().
[1:8..1:9) <= _empty_/test.f().[T]
[1:11..1:12) <= _empty_/test.f().(c)
[1:14..1:17) => scala/Int#
[1:21..1:22) => _empty_/test.f().[T]
[1:26..1:29) => scala/Predef.`???`().
[2:13..2:14) <= _empty_/test.A#
[2:14..2:14) <= _empty_/test.A#`<init>`().
[2:15..2:16) <= _empty_/test.A#a.
[2:18..2:21) => scala/Int#
[3:2..3:3) => _empty_/test.f().
[3:4..3:5) => _empty_/test.A.
[3:6..3:11) => _empty_/test.A.apply().

Expectation

The should be a synthetics section with the type apply for f with the type A.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions