ModularM
Modular3y ago
19 replies
ct

newbie needs help with error messages

the code:
@register_passable("trivial")
struct Item:
    var name: StringLiteral
    var qty: Int

    fn __init__(inout self) -> Self:
        self.name = "Unnamed"
        self.qty = 0


fn main():
    var item = Item()

gives error
invalid call to '__init__': callee expects 1 argument, but 0 were specified


what should I do?
Was this page helpful?