We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The Mojo compiler crashes on the line, _list = List[Bar[TFoo]]() in the code example below. Discussed on Discord with @owenhilyard. https://discord.com/channels/1087530497313357884/1151418092052815884/1328223895408476275
_list = List[Bar[TFoo]]()
trait TFoo: fn __copyinit__(out self, other: Self): ... fn __str__(self) -> String: ... @value struct Ralph(TFoo): alias TYPE = "Ralph" fn __str__(self) -> String: return self.TYPE @value struct Waldo(TFoo): alias TYPE = "Waldo" fn __str__(self) -> String: return self.TYPE @value struct Emerson(TFoo): alias TYPE = "Emerson" fn __str__(self) -> String: return self.TYPE @value struct Bar[T: TFoo](CollectionElement): var foo: T fn __init__(out self, foo: T): self.foo = foo fn __str__(self) -> String: return self.foo.__str__() fn main(): ralph = Bar(Ralph()) waldo = Bar(Waldo()) emerson = Bar(Emerson()) print(str(ralph)) print(str(waldo)) print(str(emerson)) # _list = List[Bar[TFoo]]() # Mojo compiler crash # _list.append(Bar[Ralph](ralph)) # _list.append(Bar[Waldo](waldo)) # _list.append(Bar[Emerson](emerson))
mojo 25.1.0.dev2025011305 magic 0.6.2 - (based on pixi 0.40.0) Ubuntu 24.10 [boot OS]
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug description
The Mojo compiler crashes on the line,
_list = List[Bar[TFoo]]()
in the code example below.Discussed on Discord with @owenhilyard.
https://discord.com/channels/1087530497313357884/1151418092052815884/1328223895408476275
Steps to reproduce
System information
The text was updated successfully, but these errors were encountered: