Skip to content

Incorrect behavior for string.gmatch #462

@zyedidia

Description

@zyedidia

Gopher Lua version: 9d7d921
Go version: 1.21.0

Ran the following file:

local x = string.gmatch("asdf", "a")
print(x())
$ lua5.1 test.lua
a
$ glua test.lua
test.lua:2: bad argument #1 to x (userdata expected, got nil)
stack traceback:
        [G]: in function 'x'
        test.lua:2: in main chunk
        [G]: ?

It seems like string.gmatch produces a closure that expects some internal userdata. Thanks for your help!

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