Passing generics to DynamicVector
I'm trying to understand the traits system and am working with a toy
The original declaration (which works) starts with:
In the above I can declare a list of strings with
I have tried to add the ability to print items in the
This removes the compile error in my print method, but then I can no longer declare
the compiler errors with "'list' parameter #0 has 'ListElement' type, but value has type 'String'". But it seems like
list struct from this threadThe original declaration (which works) starts with:
In the above I can declare a list of strings with
list[String]I have tried to add the ability to print items in the
list, but CollectionElements aren't accepted by str (errors with "no matching function in call to 'str'"), so I tried making a trait that inherits from both requirements:This removes the compile error in my print method, but then I can no longer declare
list[String]. In this declarationthe compiler errors with "'list' parameter #0 has 'ListElement' type, but value has type 'String'". But it seems like
String should satisfy my new trait since it satisfied CollectionElement and should certainly satisfy Stringable. Am I doing something wrong, or is this a current bug/limitation of Mojo?GitHub![[BUG]: Mojo is getting confused in 0.6.0 with overloading and slice...](https://images-ext-1.discordapp.net/external/7E5zSTvr_8G6s5GXN1AdoWVCq1YH0Y5SdpP4zDUrNm8/https/opengraph.githubassets.com/82a07093f5653dfb5f1c5343bc85cc2b6a991a763e0293e3d60d28c30b6e3c42/modularml/mojo/issues/1408)
Bug description The compiler is choosing the wrong overload, making it break the program at runtime. Steps to reproduce Consider the following code: @value struct list[T: CollectionElement]: var _i...
