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

@:forward.new breaks with constructor closures #10007

Closed
Gama11 opened this issue Dec 19, 2020 · 0 comments
Closed

@:forward.new breaks with constructor closures #10007

Gama11 opened this issue Dec 19, 2020 · 0 comments
Labels
Milestone

Comments

@Gama11
Copy link
Member

Gama11 commented Dec 19, 2020

This code compiles, but results in a runtime error:

class Main {
	static function main() {
		final ctor = Abstract.new;
		trace(ctor()); // TypeError: Abstract.new is not a function
	}
}

@:forward.new
abstract Abstract(Impl) {}

class Impl {
	public function new() {}
}

If @:forwad.new is replaced with an explicit constructor, it works as expected.

@Gama11 Gama11 added the bug label Dec 19, 2020
@Gama11 Gama11 added this to the Release 4.2 milestone Dec 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant