Skip to content

Loops with gmatch and multiple captures #113

@Zash

Description

@Zash

This code:

local function foo(s : string) end

local str = "Hello World"

for a : string, b : string in string.gmatch(str,"(%w)(%w)") do
	foo(a);
	foo(b);
end

Gives this error when compiling:

test.tl:7:2: type error, attempt to pass '(nil)' to local 'foo' of input type '(string, value*)'
 foo(b);
 ^

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