You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When defining a lambda you currently need to also directly specify a return type, which makes sense for strict type checking, but the compiler doesn't correctly check the type of the expression or for a return inside the compound statement.
For example:
varx: Func<num>=(): num->void;// works - no error
Or also with compounds:
vary: Func<num>=(): num->{};// works - no error
Expected Behavior
The compiler should check whether the provided expression matches the type which should be returned by the lambda.
The compiler should check the code paths inside a provided compound and see whether there is an if-statement.
Steps To Reproduce
Define any lambda with an incorrect return expression, missing return statement or invalid return type.
Environment
Kipper: v0.12.0-alpha.2
Environment: Node.js 18.18.2
Operating System: ArchLinux
The text was updated successfully, but these errors were encountered:
Luna-Klatzer
changed the title
[Bug] Lambdas don't check for return type with expressions nor compoound statements
[Bug] Lambdas don't check for return type with expressions nor compound statements
Sep 16, 2024
Is there an existing issue for this?
I am following the documentation's guide
This issue exists in the latest version
Current Behavior
When defining a lambda you currently need to also directly specify a return type, which makes sense for strict type checking, but the compiler doesn't correctly check the type of the expression or for a return inside the compound statement.
For example:
Or also with compounds:
Expected Behavior
Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: