Skip to content

Sould infix work on enum? #18933

Closed
Closed
@nicolasstucki

Description

@nicolasstucki

Compiler version

3.3

Minimized example

import language.future
enum Extends[A, B]:
  case Ev[B, A <: B]() extends (A Extends B)
3 |  case Ev[B, A <: B]() extends (A Extends B)
  |                                  ^^^^^^^
  |Alphanumeric type Extends is not declared infix; it should not be used as infix operator.
  |Instead, use prefix syntax Extends[...] or backticked identifier `Extends`.
  |The latter can be rewritten automatically under -rewrite -source future-migration.

but

infix enum Extends[A, B]:
  case Ev[B, A <: B]() extends (A Extends B)
1 |infix enum Extends[A, B]:
  |           ^^^^^^^
  |           Only access modifiers are allowed on enum definitions

Question

Should infix work on enum to mark it as an infix type?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions