Skip to content

Bug in toString a CometArray #15

Description

@anouard24

I got a panic after using toString(anArray), because the builtin function toString is not supported for CometArray

>> var cc = [1, 2, 3]
CometNop
>> cc
[CometInt(1), CometInt(2), CometInt(3)]
>> println(cc)
&{3 [0xc0001020b0 0xc0001020b8 0xc0001020c0]}
CometNop
>> toString(cc)
panic: All types should have been exhausted!!

goroutine 1 [running]:
github.com/chermehdi/comet/std.ToString(0x667a58, 0xc0001042a0, 0x1)

I think, We have to implement two functions to represent objects as strings, for example:

  • A debug function should return: CometArray[CometInt(1), CometInt(2), CometInt(3)]
  • The toString function should return just [1, 2, 3]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions