thatstoasty / prism

Mojo CLI Library modeled after Cobra.
MIT License
38 stars 0 forks source link

cannot compile #21

Closed dimitrilw closed 6 months ago

dimitrilw commented 6 months ago

Cloned & tried mojo package prism/ -o /path/to/prism.mojopkg using nightly (mojo 2024.4.1618 (37a3e965)) resulting in:

Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:650:58: error: no matching method in call to '__getitem__'
        var name = flags[].lookup_name(shorthand).value()[]
                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/command.mojo:314:48: error: 'Command' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
            parent_name = self.parent[].value()[].name
                          ~~~~~~~~~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/command.mojo:333:57: error: 'Command' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
            var ancestor: String = self.parent[].value()[]._full_command()
                                   ~~~~~~~~~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/command.mojo:341:41: error: 'Command' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
            return self.parent[].value()[]._root()
                   ~~~~~~~~~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/command.mojo:369:36: error: 'Command' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
            if not parent[].value()[].parent[]:
                   ~~~~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/command.mojo:464:48: error: 'Command' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
                var cmd = self.parent[].value()[]
                          ~~~~~~~~~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:155:53: error: no matching method in call to '__getitem__'
            return string_to_bool(flag.value.value()[])
                                  ~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:170:43: error: no matching method in call to '__getitem__'
            return atol(flag.value.value()[])
                        ~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:184:34: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return Int8(value.value()[])
                    ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:196:35: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return Int16(value.value()[])
                     ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:208:35: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return Int32(value.value()[])
                     ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:220:35: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return Int64(value.value()[])
                     ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:232:35: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return UInt8(value.value()[])
                     ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:244:36: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return UInt16(value.value()[])
                      ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:256:36: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return UInt32(value.value()[])
                      ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:268:36: error: 'Int' is not subscriptable, it does not implement the `__getitem__`/`__setitem__` or `__refitem__` methods
        return UInt64(value.value()[])
                      ~~~~~~~~~~~~~^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:280:37: error: invalid call to '__getitem__': missing 1 required positional argument: 'idx'
        return Float16(value.value()[])
                       ~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: function declared here
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:292:37: error: invalid call to '__getitem__': missing 1 required positional argument: 'idx'
        return Float32(value.value()[])
                       ~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: function declared here
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:305:54: error: no matching method in call to '__getitem__'
            return string_to_float(flag.value.value()[])
                                   ~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:313:38: error: no matching method in call to '__getitem__'
            if flag[][].value.value()[] != "":
               ~~~~~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:585:35: error: no matching method in call to '__getitem__'
            and self.value.value()[] == other.value.value()[]
                ~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
Included from prism/__init__.mojo:1:
/Users/dimitri/code/MOJO-PACKAGES/prism/prism/flag.mojo:585:60: error: no matching method in call to '__getitem__'
            and self.value.value()[] == other.value.value()[]
                                        ~~~~~~~~~~~~~~~~~~~^~
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'idx'
from .command import (
^
prism/__init__.mojo:1:1: note: candidate not viable: missing 1 required positional argument: 'span'
from .command import (
^
mojo: error: failed to parse the provided Mojo source module
thatstoasty commented 6 months ago

You'll need to update your nightly mojo version. They pushed an update recently so that Optional's .value() returns a reference rather than a copy.

dimitrilw commented 6 months ago

Gah! ....I need an auto-updater routine. :D

dimitrilw commented 6 months ago

Perhaps a badge here, too. :)

Mojo Nightly 2024.4.2414

...not sure which version to actually put in badge, so I just used the current version. More accurate might be a version or two earlier. Don't know. 🤷🏻

dimitrilw commented 6 months ago

Oh, forgot to note that it compiled after I got mojo version updated. Closing.