diff --git a/stdlib/src/builtin/object.mojo b/stdlib/src/builtin/object.mojo index c0cff3ea08..c54d99fc18 100644 --- a/stdlib/src/builtin/object.mojo +++ b/stdlib/src/builtin/object.mojo @@ -755,6 +755,7 @@ struct object( # FIXME: None literal should be of NoneType not !kgen.none. @doc_private @always_inline + @implicit fn __init__(out self, none: __mlir_type.`!kgen.none`): """Initializes a none value object from a `None` literal. diff --git a/stdlib/test/builtin/test_none.mojo b/stdlib/test/builtin/test_none.mojo index 637ef66216..8c153ad329 100644 --- a/stdlib/test/builtin/test_none.mojo +++ b/stdlib/test/builtin/test_none.mojo @@ -47,6 +47,7 @@ struct FromNone: fn __init__(out self, none: __mlir_type.`!kgen.none`): self = NoneType() + @implicit fn __init__(out self, value: Int): self.value = value