-
Notifications
You must be signed in to change notification settings - Fork 33
Failing test #1
Comments
The latest message of @inosik in this issue fable-compiler/Fable#1199 (comment) about:
make me think of the error we are facing this project. Perhaps, I am using the point-free style without knowing it. |
I just tried with Fable development version and the test passed 😸 I will release Fable 1.3.3 so you can give it a try. I also got a warning message about this line so I recommend changing it to |
@alfonsogarciacaro Awesome, so this was somehow related to the linked issue probably. Yes, I was in the process to add explicit arguments in every function. Thanks you :) |
@alfonsogarciacaro This line seems to be failing now :) And what I found strange is that it don't execute the function I am expecting. If you look at the Problem, is the variable PS: I tried to explain my observation but can be easier to just run the test and add logs into the decoder used :) Again thanks if you take the time to take a look at this problem. |
Hum, I think I know where the error is coming from. The probably is coming from
Here is the result of (...args) => {
// _this = _this || this;
const actualArgsLength = Math.max(args.length, 1);
expectedArgsLength = Math.max(expectedArgsLength || f.length, 1);
if (actualArgsLength >= expectedArgsLength) {
const restArgs = args.splice(expectedArgsLength);
const res = f(...args);
if (typeof res === "function") {
const newLambda = CurriedLambda(res);
return restArgs.length === 0 ? newLambda : newLambda(...restArgs);
}
else {
return res;
}
}
else {
return CurriedLambda((...args2) => {
return f(...args.concat(args2));
}, expectedArgsLength - actualArgsLength);
}
} And if I execute, the function manually in the debugger I understand that's it's containing the Example result: The right value for the Yes, I admit there a lot of time "value" in this report.. So, to fix the failing test, we need to have |
Ok finally I only forget to apply |
Copy & pasted from Slack so I don't forget ;)
This test is failing. It's probably related to how Fable translate the custom function.
You can debug doing:
./build.sh DotnetBuild
, in a terminal :yarn run test
and in anotheryarn run mocha ./tests/bin/
or press F5 into VSCode to be able to set breakpoint.The text was updated successfully, but these errors were encountered: