Closed adamish closed 1 year ago
Describe the bug If you call a shim method with more than 4 parameters you get an assertion error. I cannot seem to find this documented.
To Reproduce
main.ts
/** */ //% namespace foons { /** */ //% shim=foons::fooNative export function foo(a : Number, b : Number, c : Number, d : Number, e : Number): void { console.log("test") } } foons.foo(1, 2, 3, 4, 5);
foo.cpp
namespace foons { /** * */ //% void fooNative(int a, int b, int c, int d, int e) { } }
Actual behaviour
main.ts(1,1): error TS9200: Assertion failed
Expected behaviour
PXT microbit 5.1.2
Desktop (please complete the following information):
Additional context Note same code works if you change to use 4 parameters (remove e from both typescript and .cpp)
@mmoskal by design constraint right?
Yes, ARM calling convention changes when there is more than 4 arguments and the current code generator doesn't support this.
Can't fix without lot of compiler changes. Sorry!
Describe the bug If you call a shim method with more than 4 parameters you get an assertion error. I cannot seem to find this documented.
To Reproduce
main.ts
foo.cpp
Actual behaviour
Expected behaviour
PXT microbit 5.1.2
Desktop (please complete the following information):
Additional context Note same code works if you change to use 4 parameters (remove e from both typescript and .cpp)