Skip to content

An implicit class may not be top-level #5915

Closed
@drdozer

Description

@drdozer

Top level declarations seem a bit hit and miss.

implied RunNNFExpr[B] for RunDSL[NNF[B], B] = _.terminal

implied RunNNFImpl[B] for RunDSL[NNF[B], B] {
  override def runDSL(b: NNF[B]): B = b.terminal
}

The top declaration RunNNFExpr works fine. The bottom declaration RunNNFImpl fails to compile with:

[error] 93 |implied RunNNF[B] for RunDSL[NNF[B], B] {
[error]    |^
[error]    |An implicit class may not be top-level
[error] 94 |  override def runDSL(b: NNF[B]): B = b.terminal
[error] 95 |}

This seems like a strange inconsistency.

Metadata

Metadata

Assignees

No one assigned

    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