intellij-haxe icon indicating copy to clipboard operation
intellij-haxe copied to clipboard

Overloads feature is missing

Open barisyild opened this issue 1 year ago • 1 comments

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 avatar Jun 17 '23 18:06 barisyild

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

m0rkeulv avatar Jun 19 '23 21:06 m0rkeulv