mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG]: Tuple unpacking doesn't support generic type?

Open soraros opened this issue 1 year ago • 1 comments

Bug description

As title. Not sure it's the correct title though.

Steps to reproduce

fn swap(inout v: DynamicVector):
  v[0], v[1] = v[1], v[0]

Code crashes with:

<unknown>:0: error: variadic sequence element #0 has type
  '!lit.trait<@"$stdlib"::@"$collections"::@"$vector"::@CollectionElement>'
but expected
  '!kgen.type'

System information

Mojo 0.7.0 on Docker, Intel Mac

soraros avatar Jan 28 '24 01:01 soraros

I was able to repro this, and I'm even seeing a crash after the error. @stumpOS could you please take a look?

laszlokindrat avatar Feb 08 '24 20:02 laszlokindrat