Skip to content

assertion failure in Typer during tab completion on NamedTuple in repl #25890

@eejbyfeldt

Description

@eejbyfeldt

Compiler version

3.8.5-RC1-bin-20260421-d23d5ef-NIGHTLY-git-d23d5ef

Minimized code

$ scala-cli -S 3.nightly
Apr 21, 2026 1:47:13 PM org.jline.utils.Log logr
WARNING: The Parser of class dotty.tools.repl.JLineTerminal$$anon$2 does not support the CompletingParsedLine interface. Completion with escaped or quoted words won't work correctly.
Welcome to Scala 3.8.5-RC1-bin-20260421-d23d5ef-NIGHTLY-git-d23d5ef (21.0.10, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                               
scala> val a = (a=1, b=2)
val a: (a : Int, b : Int) = (1, 2)

scala> a.<tab completion>

Output (click arrow to expand)

Details
Apr 21, 2026 1:47:25 PM dotty.tools.dotc.interactive.Completion$Completer tryApplyingReceiverToExtension$1
WARNING: Exception when trying to apply extension method:
 assertion failed: position not set for a.toTuple # -1 of class dotty.tools.dotc.ast.Trees$Select in <completions>
scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:10)
dotty.tools.dotc.typer.Typer$.assertPositioned(Typer.scala:76)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:4013)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:4023)
dotty.tools.dotc.typer.Typer.adaptToSubType$1(Typer.scala:5035)
dotty.tools.dotc.typer.Typer.adaptNoArgsOther$1(Typer.scala:4858)
dotty.tools.dotc.typer.Typer.adaptNoArgs$1(Typer.scala:4938)
dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:5207)
dotty.tools.dotc.typer.Typer.adapt(Typer.scala:4400)
dotty.tools.dotc.typer.ProtoTypes$FunProto.typedArg(ProtoTypes.scala:566)
dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:1265)
dotty.tools.dotc.typer.Applications$ApplyToUntyped.typedArg(Applications.scala:1265)
dotty.tools.dotc.typer.Applications$Application.addTyped$1(Applications.scala:836)
dotty.tools.dotc.typer.Applications$Application.matchArgs(Applications.scala:922)
dotty.tools.dotc.typer.Applications$Application.init(Applications.scala:661)
dotty.tools.dotc.typer.Applications$TypedApply.<init>(Applications.scala:1112)
dotty.tools.dotc.typer.Applications$ApplyToUntyped.<init>(Applications.scala:1264)
dotty.tools.dotc.typer.Applications.ApplyTo(Applications.scala:1571)
dotty.tools.dotc.typer.Applications.ApplyTo$(Applications.scala:521)
dotty.tools.dotc.typer.Typer.ApplyTo(Typer.scala:163)
dotty.tools.dotc.typer.Applications.simpleApply$1(Applications.scala:1361)
dotty.tools.dotc.typer.Applications.$anonfun$19(Applications.scala:1477)
dotty.tools.dotc.typer.Typer$.tryEither(Typer.scala:136)
dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:1496)
dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:1545)
dotty.tools.dotc.typer.Applications.typedApply$(Applications.scala:521)
dotty.tools.dotc.typer.Typer.typedApply(Typer.scala:163)
dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:3837)
dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:3931)
dotty.tools.dotc.typer.Typer.typed(Typer.scala:4018)
dotty.tools.dotc.typer.Applications.extMethodApply(Applications.scala:2987)
dotty.tools.dotc.typer.Applications.extMethodApply$(Applications.scala:521)
dotty.tools.dotc.typer.Typer.extMethodApply(Typer.scala:163)
dotty.tools.dotc.typer.Applications.tryApplyingExtensionMethod(Applications.scala:3032)
dotty.tools.dotc.typer.Applications.tryApplyingExtensionMethod$(Applications.scala:521)
dotty.tools.dotc.typer.Typer.tryApplyingExtensionMethod(Typer.scala:163)
dotty.tools.dotc.interactive.Completion$Completer.tryApplyingReceiverToExtension$1(Completion.scala:613)
dotty.tools.dotc.interactive.Completion$Completer.$anonfun$24(Completion.scala:661)
scala.collection.immutable.List.flatMap(List.scala:287)
scala.collection.immutable.List.flatMap(List.scala:282)
dotty.tools.dotc.interactive.Completion$Completer.extensionCompletions(Completion.scala:658)
dotty.tools.dotc.interactive.Completion$Completer.selectionCompletions(Completion.scala:497)
dotty.tools.dotc.interactive.Completion$.computeCompletions(Completion.scala:256)
dotty.tools.dotc.interactive.Completion$.rawCompletions(Completion.scala:93)
dotty.tools.dotc.interactive.Completion$.completions(Completion.scala:76)
dotty.tools.repl.ReplDriver.completions$$anonfun$1(ReplDriver.scala:357)
scala.util.Either.map(Either.scala:440)
dotty.tools.repl.ReplDriver.completions(ReplDriver.scala:350)
dotty.tools.repl.ReplDriver.$anonfun$2(ReplDriver.scala:196)
org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4468)
org.jline.reader.impl.LineReaderImpl.doComplete(LineReaderImpl.java:4434)
org.jline.reader.impl.LineReaderImpl.expandOrComplete(LineReaderImpl.java:4373)
org.jline.reader.impl.LineReaderImpl$1.apply(LineReaderImpl.java:3862)
org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:720)
org.jline.reader.impl.LineReaderImpl.readLine(LineReaderImpl.java:511)
dotty.tools.repl.JLineTerminal.readLine(JLineTerminal.scala:129)
dotty.tools.repl.ReplDriver.readLine$1(ReplDriver.scala:214)
dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:226)
dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:267)
dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:301)
dotty.tools.repl.ReplDriver.runBody$$anonfun$1(ReplDriver.scala:275)
dotty.tools.repl.ScalaClassLoader$.asContext(ScalaClassLoader.scala:32)
dotty.tools.repl.ReplDriver.runBody(ReplDriver.scala:275)
dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:267)
dotty.tools.repl.ReplDriver.tryRunning(ReplDriver.scala:166)
dotty.tools.repl.Main$.main(Main.scala:8)
dotty.tools.repl.Main.main(Main.scala)

Metadata

Metadata

Assignees

Labels

area:replitype:bugitype:crashregressionThis worked in a previous version but doesn't anymorestat:needs bisectionNeed to use nightly builds and git bisect to find out the commit where this issue was introduced

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions