mojo icon indicating copy to clipboard operation
mojo copied to clipboard

[BUG] Mojo process killed while instantiating a custom data type

Open TheAbhilash23 opened this issue 10 months ago • 0 comments

Bug description

The code i executed

from utils.variant import Variant from collections.optional import Optional

alias PrimitiveTypes = Variant[String, Int, Bool] alias PrimitiveJSONType = Optional[Variant[String, Int, Bool]] alias CompositeJSONType = Optional[Variant[List[PrimitiveJSONType], Dict[String, PrimitiveJSONType], List[Dict[String, PrimitiveJSONType]]]]

@value struct MultimorphicDict(Stringable):

var _dict: Dict[String, CompositeJSONType]


fn __init__(inout self):
    self._dict = Dict[String, CompositeJSONType]()
    


fn __str__(self: Self) -> String:
    return "Needs Implementation"

The compiler hangs and runs out of memory and then ultimately gets killed

image

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
  • If applicable, add screenshots to help explain the problem.
  • If using the Playground, name the pre-existing notebook that failed and the steps that led to failure.
  • Include anything else that might help us debug the issue.

System information

- What OS did you do install Mojo on ? Ubuntu 22.04
- Provide version information for Mojo by pasting the output of `mojo -v` mojo 24.2.0 (c2427bc5)
- Provide Modular CLI version by pasting the output of `modular -v`modular 0.7.1 (28ddab26)

TheAbhilash23 avatar Apr 20 '24 04:04 TheAbhilash23