Skip to content

Cannot pass enum values as inline parameters #7964

@flomebul

Description

@flomebul

minimized code

enum Nums { case One }

def fok(that: Nums) = ???
val ok = fok(Nums.One)

inline def fko(inline that: Nums) = ???
val ko = fko(Nums.One)
The compiler rejects the use of `One` as an inline parameter.
-- Error: ABug.scala:7:18 ------------------------------------------------------
7 |val ko = fko(Nums.One)
  |             ^^^^^^^^
  |             argument to inline parameter must be a known value
1 error found

expectation

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions