Nim icon indicating copy to clipboard operation
Nim copied to clipboard

Internal error: getTypeDescAux(tyBuiltInTypeClass) with varargs[enum]

Open PixeyeHQ opened this issue 2 years ago • 2 comments

Hi, Nim team and caring community! :) I'm not sure if it's a bug, but since no warnings popped in the terminal I thought it will be legal to write as in the example below.

Throwing error getTypeDescAux(tyBuiltInTypeClass):

type Action = enum
  Fire
  Jump

proc test(keys: varargs[enum]) =
  for k in keys:
    echo k
    
test(Fire,Jump)

Works:

type Action = enum
  Fire
  Jump


proc test[T:enum](keys: varargs[T]) =
  for k in keys:
    echo k
    

test(Fire,Jump)
$ nim -v
Nim Compiler Version 1.6.6

PixeyeHQ avatar Jul 11 '22 07:07 PixeyeHQ

Same error either

type Flags = enum
  a, b

proc toX[T: SomeUnsignedInt, E: enum](s: varargs[E]): string = ""

echo toX[uint16, enum](a, b)
Nim Compiler Version 1.6.6 [Linux: amd64]

sumatoshi avatar Sep 01 '22 01:09 sumatoshi

guess because enum is not concret type

bung87 avatar Sep 20 '22 11:09 bung87