Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ..cannot be converted from 'List[Int]' to 'List[Int]' #2956

Open
sa- opened this issue Jun 5, 2024 · 3 comments
Open

[BUG] ..cannot be converted from 'List[Int]' to 'List[Int]' #2956

sa- opened this issue Jun 5, 2024 · 3 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label QOI

Comments

@sa-
Copy link

sa- commented Jun 5, 2024

Bug description

The error is invalid initialization: argument #1 cannot be converted from 'List[Int]' to 'List[Int]', although I would hope the compiler would be able to handle this

Steps to reproduce

Clone the arrow.mojo repo at this commit: mojo-data/arrow.mojo@271d920

git clone https://github.com/mojo-data/arrow.mojo.git
cd arrow.mojo
git checkout 271d920

And then run

mojo test -I .

System information

- What OS did you do install Mojo on ?
MacOS
- Provide version information for Mojo by pasting the output of `mojo -v`
mojo 2024.5.2205 (d3cacc7e)
- Provide Modular CLI version by pasting the output of `modular -v`
modular 0.8.0 (39a426b5)
@sa- sa- added bug Something isn't working mojo-repo Tag all issues with this label labels Jun 5, 2024
@sa-
Copy link
Author

sa- commented Jun 5, 2024

And on a different note the LSP doesn't seem to recognize the arrow/ dir, this feels like it might have been reported but I wasn't able to find an issue for it. Would be happy to file a separate issue "LSP should include root directory in its mojo path" if needed

@ematejska
Copy link
Collaborator

Contained Reproducer

struct ArrowFixedWidthBuffer[T: AnyTrivialRegType]:
    fn __init__(inout self, values: List[T]):
        var byte_width = sizeof[T]()


def main():
    var int_arrow_buf = ArrowFixedWidthBuffer(List[Int]())

@martinvuyk
Copy link
Contributor

FYI @sa-
temporary workaround:

struct ArrowFixedWidthBuffer[T: AnyTrivialRegType]:
    alias _type = T

    fn __init__(inout self, values: List[Self._type]):
        var byte_width = sizeof[T]()


def main():
    alias Arr = ArrowFixedWidthBuffer[Int]
    var int_arrow_buf = Arr(List[Arr._type]())

@ematejska ematejska added the QOI label Jul 18, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label QOI
Projects
None yet
Development

No branches or pull requests

3 participants