You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Constructor references missing for implicit super() and anonymous subclass creation #1083
Version: scip-java 0.12.3 (semanticdb-java 0.12.3), JDK 21, Maven 3.9, Linux. Measured against the compiler on a public project (google/gson at a961b0fe088f8558d00cc1b56e506a3656907a91): of 556 uses of constructors that javac reports, 67 are missing from the index (58 implicit super() calls, 9 anonymous subclasses). Everything else (methods, fields, classes, interfaces, enum constants) agrees.
Reproduction
Plain Maven project, maven.compiler.source and target 17. src/main/java/p/A.java:
Run scip-java index --output index.scip in the project folder.
Line
What javac resolves
What the index has
9 static class Derived extends Base {}
the default constructor of Derived calls Base#<init>().
the definition of Derived#<init>(). at the class name, the type Base#; no occurrence of Base#<init>().
11-13 Explicit(int a) with body
the implicit super() at the opening brace of the body calls Base#<init>().
the definition of Explicit#<init>().; no occurrence of Base#<init>().
19 return new Base() {
the anonymous class calls Base#<init>().
only the type Base#
Expected
A reference occurrence of the superclass constructor at the place where the compiler puts the implicit call (the opening brace of the body, or the class name for a default constructor), like for an explicit super(...), which is written (Base#<init>(). on the keyword).
A reference occurrence of the constructor at the type name of new Base() { ... }, like for new Base() without a body.
Activity