Skip to content

Regression in typer for named arguments of infix methods in ghostdogpr/caliban #21767

Closed
@WojciechMazur

Description

@WojciechMazur

Based on OpenCB failure for ghostdogpr/caliban - build logs
Affects also:

The new behaviour might have become present by the stabilization of named tuples. Previously named tuples syntax was not tried without an explicit experimental flag enabled.

Compiler version

Last good release: 3.6.0-RC1-bin-20241003-a672e05-NIGHTLY
First bad release: 3.6.0-RC1-bin-20241005-6fa81cf-NIGHTLY

Bisect points to 87cdbc8

Minimized code

trait GraphQLRequest
sealed trait SelectionBuilder[+A]:
  def toGraphQL[A1 >: A](queryName: Option[String] = None): GraphQLRequest = ???

trait Character
trait Field[A] extends SelectionBuilder[A]

def query = 
  val field: Field[Character]  = ???
  val works = field.toGraphQL(queryName = Some("GetCharacter"))
  val fails = field `toGraphQL` (queryName = Some("GetCharacter"))

Output

-- Error: /Users/wmazur/projects/sandbox/test.scala:11:44 ----------------------
11 |  val fails = field `toGraphQL` (queryName = Some("GetCharacter"))
   |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |method toGraphQL in trait SelectionBuilder: (queryName: Option[String]): GraphQLRequest does not have a parameter equeryName

Expectation

The compiler should interpret infix apply as list of arguments instead of named tuple.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions