Skip to content

deprecate method values for nullary methods #489

Closed
@adriaanm

Description

@adriaanm

Currently, http://www.scala-lang.org/files/archive/spec/2.12/06-expressions.html#method-values says:

The expression e _ is well-formed if e is of method type or if e is a call-by-name parameter. [...]
If e is a parameterless method or call-by-name parameter of type => T, e _ represents the function of type () => T, which evaluates e when it is applied to the empty parameter list ().

Since we've removed eta-expansion for nullary methods, for consistency we should also deprecate and drop the last part re: "parameterless method or call-by-name parameter". Those will need to be written explicitly using () => e.

Eventually (ideally), all method references will be eta-expanded regardless of expected type, and method value syntax will be dropped since it's redundant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions