JDK-8365672 : java.lang.AssertionError: Missing type variable in where clause: A
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 24
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: generic
  • CPU: generic
  • Submitted: 2025-08-16
  • Updated: 2025-11-20
  • Resolved: 2025-11-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdResolved
Related Reports
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
I encountered the below error while compiling my code. This happens on a large codebase and I haven't been able to narrow the cause down to a small example yet.

An exception has occurred in the compiler (24.0.2). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
java.lang.AssertionError: Missing type variable in where clause: A
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter.unique(RichDiagnosticFormatter.java:252)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitTypeVar(RichDiagnosticFormatter.java:403)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitTypeVar(RichDiagnosticFormatter.java:345)
	at jdk.compiler/com.sun.tools.javac.code.Type$TypeVar.accept(Type.java:1709)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:136)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visitWildcardType(Printer.java:264)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visitWildcardType(Printer.java:52)
	at jdk.compiler/com.sun.tools.javac.code.Type$WildcardType.accept(Type.java:868)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:136)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visitTypes(Printer.java:108)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visitClassType(Printer.java:241)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitClassType(RichDiagnosticFormatter.java:385)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitClassType(RichDiagnosticFormatter.java:345)
	at jdk.compiler/com.sun.tools.javac.code.Type$ClassType.accept(Type.java:1053)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:136)
	at jdk.compiler/com.sun.tools.javac.code.Printer.printMethodArgs(Printer.java:345)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitMethodSymbol(RichDiagnosticFormatter.java:442)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter$RichPrinter.visitMethodSymbol(RichDiagnosticFormatter.java:345)
	at jdk.compiler/com.sun.tools.javac.code.Symbol$MethodSymbol.accept(Symbol.java:2314)
	at jdk.compiler/com.sun.tools.javac.code.Printer.visit(Printer.java:147)
	at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArgument(AbstractDiagnosticFormatter.java:209)
	at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.formatArguments(AbstractDiagnosticFormatter.java:167)
	at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMessage(BasicDiagnosticFormatter.java:111)
	at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatMeta(BasicDiagnosticFormatter.java:186)
	at jdk.compiler/com.sun.tools.javac.util.BasicDiagnosticFormatter.formatDiagnostic(BasicDiagnosticFormatter.java:100)
	at jdk.compiler/com.sun.tools.javac.util.AbstractDiagnosticFormatter.format(AbstractDiagnosticFormatter.java:123)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter.format(RichDiagnosticFormatter.java:118)
	at jdk.compiler/com.sun.tools.javac.util.RichDiagnosticFormatter.format(RichDiagnosticFormatter.java:72)
	at jdk.compiler/com.sun.tools.javac.util.Log.writeDiagnostic(Log.java:747)
	at jdk.compiler/com.sun.tools.javac.util.Log$DefaultDiagnosticHandler.report(Log.java:722)
	at jdk.compiler/com.sun.tools.javac.util.Log.report(Log.java:675)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve.logResolveError(Resolve.java:4030)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve.accessInternal(Resolve.java:2634)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve.accessMethod(Resolve.java:2652)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve$BasicLookupHelper.access(Resolve.java:3539)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve$12.access(Resolve.java:2829)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve.lookupMethod(Resolve.java:3789)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2819)
	at jdk.compiler/com.sun.tools.javac.comp.Resolve.resolveQualifiedMethod(Resolve.java:2813)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.selectSym(Attr.java:4527)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:4414)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:2577)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:676)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.visitApply(Attr.java:2646)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodInvocation.accept(JCTree.java:1861)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:676)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:729)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.visitExec(Attr.java:2354)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCExpressionStatement.accept(JCTree.java:1648)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:676)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:750)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStats(Attr.java:769)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.visitBlock(Attr.java:1453)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCBlock.accept(JCTree.java:1137)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:676)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:750)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.visitMethodDef(Attr.java:1242)
	at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCMethodDecl.accept(JCTree.java:961)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribTree(Attr.java:676)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribStat(Attr.java:750)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClassBody(Attr.java:5632)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5520)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attribClass(Attr.java:5344)
	at jdk.compiler/com.sun.tools.javac.comp.Attr.attrib(Attr.java:5281)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.attribute(JavaCompiler.java:1356)
	at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:978)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
	at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
	at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:57)
	at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1352)
	at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1092)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
	at org.apache.tools.ant.Main.runBuild(Main.java:818)
	at org.apache.tools.ant.Main.startAnt(Main.java:223)
	at org.apache.tools.ant.Main.start(Main.java:190)
	at org.apache.tools.ant.Main.main(Main.java:274)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:31)


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Javac compiles the code without error or gives specific diagnostics and aborts.
ACTUAL -
Internal compiler error


Comments
A reproduction is missing. If more information appears for this issue we can reopen.
20-11-2025

The linked issue presents a similar situation (JDK-8334757). The fix was to cover another case in `preprocessArgument` that was missing. This is possibly related.
20-11-2025

This happens on a large code base. Impact -> M (Somewhere in-between the extremes) Likelihood -> L (Happens on specific large project) Workaround -> M (Somewhere in-between the extremes) Priority -> P4
18-08-2025