Skip to content

Class and method type parameters named _ no longer supported #235

Closed
@retronym

Description

@retronym

Intentional? It is arguably poor style, but should probably be deprecated before removal.

% cat sandbox/test.scala
trait T[_] {
  def foo[_] = 0
  def bar[M[_]] = 0
}

% scalac-hash v2.11.4 ./sandbox/test.scala
warning: there was one feature warning; re-run with -feature for details
one warning found

% ./bin/dotc ./sandbox/test.scala
./sandbox/test.scala:1: error: identifier expected but '_' found.
trait T[_] {
        ^
./sandbox/test.scala:2: error: identifier expected but '_' found.
  def foo[_] = 0
          ^
two errors found

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions