Skip to content

infix methods accept type parameters in multiple positions #9091

Closed
@smarter

Description

@smarter

http://dotty.epfl.ch/docs/reference/contextual/extension-methods.html says:

If an extension method has type parameters, they come immediately after the def and are followed by the extended parameter.

But in fact they're also accepted after the method name:

scala> def (x: A) foo[A]: A = x
def foo[A](x: A): A

scala> def [A] (x: A) foo: A = x
def foo[A](x: A): A

@odersky: I assume this is a remnant of a previous syntax and not intentional?

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