Nim icon indicating copy to clipboard operation
Nim copied to clipboard

type mismatch: required typedesc[seq] but got typedesc[seq]

Open shirleyquirk opened this issue 3 years ago • 2 comments
trafficstars

seq and array seems to be a special case

Example

type Seq[U] = seq[U]

proc foo(s:typedesc[seq]) = echo "seq works"

proc foo(s:typedesc[Seq]) = echo "Seq works"

Seq.foo #works

seq.foo #compile error

Current Output

Error: type mismatch: got <typedesc[seq]>
but expected one of:
proc foo(s: typedesc[Seq])
  first type mismatch at position: 1
  required type for s: typedesc[Seq]
  but expression 'seq' is of type: typedesc[seq]
proc foo(s: typedesc[seq])
  first type mismatch at position: 1
  required type for s: typedesc[seq]
  but expression 'seq' is of type: typedesc[seq]

Expected Output

Seq works
seq works
$ nim -v
Nim Compiler Version 1.6.0

shirleyquirk avatar Nov 21 '21 18:11 shirleyquirk