Skip to content

Generic converter doesn't work #3850

@endragor

Description

@endragor

Not sure if it's expected to work, but here is the sample:

type
  EnumContainer[T: enum] = object
    val: T

  MyEnum = enum
    meEnumValue

converter fromEnum[T: enum](t: T): EnumContainer[T] =
  result = EnumContainer(val: t)

let cont: EnumContainer[MyEnum] = meEnumValue
# Error: type mismatch: got (MyEnum) but expected 'EnumContainer[MyEnum]'

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions