Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loops with gmatch and multiple captures #113

Open
Zash opened this issue Feb 11, 2017 · 0 comments
Open

Loops with gmatch and multiple captures #113

Zash opened this issue Feb 11, 2017 · 0 comments

Comments

@Zash
Copy link

Zash commented Feb 11, 2017

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);
 ^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant