Skip to content

Attempting to invoke a metatable's method in a native library throws IndexError #2

@EmmaTheMartian

Description

@EmmaTheMartian
import random
let rand = random.new()
print(rand.next())

# Output:
Error in main.metis:3:11: IndexError: Cannot index a non indexable value of type native with index "next"

|> print(rand.next())
             ^~~~~~^

This also occurs with the Regex library:

import regex
let a = regex.compile("a")
let matches = a.match("asdf")

# Output:
Error in main.metis:3:16: IndexError: Cannot index a non indexable value of type native with index "match"

|> let matches = a.match("asdf")
                  ^~~~~~~~~~~~~^

I'm not exactly sure what causes the error, however after looking at source code I have narrowed it down to being specifically native libraries that throw this error.

I am also using the latest version built from source instead of the latest one from releases, if that changes anything.

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