Skip to content

bad parameter reference F at typer #15293

Closed
@tgodzik

Description

@tgodzik

Compiler version

3.1.2

Minimized code

trait C[F[_]]:
  val <<f@@oo>>: F[Int]

Output

dotty.tools.dotc.core.TypeError: bad parameter reference F at typer
the parameter is type F in trait C but the prefix <noprefix>
does not define any corresponding arguments.
idx = 0, args = List()
        at dotty.tools.dotc.core.Types$NamedType.argDenot(Types.scala:2326)
        at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
        at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2258)
        at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2213)
        at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2201)
        at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:185)
        at dotty.tools.dotc.core.Types$AppliedType.tyconTypeParams(Types.scala:4456)
        at dotty.tools.dotc.core.Types$TypeAccumulator.foldOver(Types.scala:6004)
        at dotty.tools.dotc.core.Types$ExistsAccumulator.apply(Types.scala:6095)
        at dotty.tools.dotc.core.Types$Type.existsPart(Types.scala:452)
        at dotty.tools.dotc.core.Types$Type.isErroneous(Types.scala:359)
        at scala.meta.internal.pc.printer.MetalsPrinter.tpe(MetalsPrinter.scala:67)
        at scala.meta.internal.pc.printer.MetalsPrinter.shortTypeString$1(MetalsPrinter.scala:73)
        at scala.meta.internal.pc.printer.MetalsPrinter.hoverSymbol(MetalsPrinter.scala:101)
        at scala.meta.internal.pc.HoverProvider$.hover(HoverProvider.scala:98)
        at scala.meta.internal.pc.ScalaPresentationCompiler.hover$$anonfun$1(ScalaPresentationCompiler.scala:214)
        at scala.meta.internal.pc.CompilerAccess.withSharedCompiler(CompilerAccess.scala:137)
        at scala.meta.internal.pc.CompilerAccess.withNonInterruptableCompiler$$anonfun$1(CompilerAccess.scala:125)
        at scala.meta.internal.pc.CompilerAccess.onCompilerJobQueue$$anonfun$1(CompilerAccess.scala:197)
        at scala.meta.internal.pc.CompilerJobQueue$Job.run(CompilerJobQueue.scala:139)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)

Expectation

isErroneous should not throw an exception. Not sure if it's only Metals and IDE related or is it a bigger issue?

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