Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/generators/cpp/cppRetyper.ml
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ let expression ctx request_type function_args function_type expression_tree forI
(retyper_ctx, CppCall (func, retypedArgs), return_type)
| CppFunction ( (FuncInstance (_, _, { cf_type = TFun (arg_types, _) }) as func), returnType )
| CppFunction ( (FuncStatic (_, _, { cf_type = TFun (arg_types, _) }) as func), returnType )
| CppFunction ( (FuncSuper (_, _, { cf_type = TFun (arg_types, _) }) as func), returnType )
| CppFunction ( (FuncThis ({ cf_type = TFun (arg_types, _) }, _) as func), returnType ) ->
let arg_types =
List.map
Expand Down
23 changes: 23 additions & 0 deletions tests/misc/cppia/projects/Issue9990/Main.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// template function converts to dynamic array
function wrap<T>(a:Array<T>):Array<T> {
return a;
}

class Parent {
function method(a:Array<Int>):Array<Int> {
return a.copy();
}
}

class Child extends Parent {
public function new() {}

override public function method(a:Array<Int>):Array<Int> {
return super.method(wrap(a));
}
}

function main() {
var c = new Child();
c.method([7, 8, 9]);
}
3 changes: 3 additions & 0 deletions tests/misc/cppia/projects/Issue9990/compile.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--main Main
--cppia bin/script.cppia
--cmd haxelib run hxcpp bin/script.cppia
2 changes: 2 additions & 0 deletions tests/misc/cppia/run.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-cp ../src
--run Main
3 changes: 3 additions & 0 deletions tests/runci/targets/Cpp.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import runci.Config.*;
class Cpp {
static public var gotCppDependencies = false;
static final miscCppDir = getMiscSubDir('cpp');
static final miscCppiaDir = getMiscSubDir('cppia');

static public function getCppDependencies() {
if (gotCppDependencies) return;
Expand Down Expand Up @@ -99,5 +100,7 @@ class Cpp {

changeDirectory(miscCppDir);
runCommand("haxe", ["run.hxml"]);
changeDirectory(miscCppiaDir);
runCommand("haxe", ["run.hxml"]);
}
}
Loading