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

Overloads feature is missing #1118

Open
barisyild opened this issue Jun 17, 2023 · 1 comment
Open

Overloads feature is missing #1118

barisyild opened this issue Jun 17, 2023 · 1 comment

Comments

@barisyild
Copy link

barisyild commented Jun 17, 2023

class Test {
	static function main() {
		trace("Haxe 4.2 overload example");
		var doc = new Document();
		doc.append('hello');
		doc.append(new Image());
		doc.append(new Table());
	}
}

// stub a Document type (doesn't do anything!)
class Document {
	public function new() {}

	public overload extern inline function append(string: String) {
		trace('append string!');
	}
	
	public overload extern inline function append(image: Image) {
		trace('append image!');
	}
	
	public overload extern inline function append(table: Table) {
		trace('append table!');
	}
}

// stub for an Image type
class Image {
	public function new() {}
}

// stub for an Table type
class Table {
	public function new() {}
}

https://try.haxe.org/#35228D26

https://community.haxe.org/t/sneaky-feature-showcase-overloads-in-haxe-4-2/2971

@barisyild barisyild changed the title overloads support Overloads support Jun 17, 2023
@barisyild barisyild changed the title Overloads support Overloads feature is missing Jun 17, 2023
@m0rkeulv
Copy link
Member

the latest build (RC1) supports parsing the keyword, however the semantics are missing so you will see Duplicate class field declaration warnings

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

2 participants