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

Assertion Error When Using ForOf & this Keyword #2371

Open
garbearrr opened this issue May 20, 2023 · 0 comments
Open

Assertion Error When Using ForOf & this Keyword #2371

garbearrr opened this issue May 20, 2023 · 0 comments

Comments

@garbearrr
Copy link

Description

Similar to #1417
Map throws assertion error when attempting to extend map functionality in ForOf iteration.

Reproduction

map<T extends defined>(fn: (value: V, key: K, collection: this) => T): T[] {
	const arr: T[] = [];
	for (const [key, value] of this) {
		arr.push(fn(value, key, this));
	}
	return arr;
}

Error

> rbxtsc -w true 

Error: Assertion Failed! ForOf iteration type not implemented: this
This is a compiler bug! Please submit a bug report here:
https://github.com/roblox-ts/roblox-ts/issues
...

Node.js v19.8.1
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