Skip to content

[cppia] Weird exception on Array.copy involving super calls #9990

@RealyUniqueName

Description

@RealyUniqueName
class Main {
	static function main() {
		var c = new Child();
		toArray(c.method([7, 8, 9]));
	}

	//removing `inline` here fixes it
	static public inline function toArray(a:Array<Int>):Array<Int>
		return a.copy();

	//or adding `inline` here, or changing `Array<T>` to `Array<Int>`
	static public function append<T>(a:Array<T>):Array<T> {
		return a;
	}
}

class Parent {
	public function new() {}

	public function method(a:Array<Int>):Array<Int> {
		return a;
	}
}

class Child extends Parent {
	override public function method(a:Array<Int>):Array<Int> {
		// or removing `super.method` call here
		return super.method(Main.append(a));
	}
}
$ haxe -main Main --cppia test.cppia && haxelib run hxcpp test.cppia
Error : hxSehException

Reproducible with all Haxe versions.

Metadata

Metadata

Assignees

Labels

bugplatform-cppEverything related to CPP / C++

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions