Is there an existing issue for this?
I am following the documentation's guide
This issue exists in the latest version
Current Behavior
Type checking always results in true expressions due to improper brace insertion in the code generator. For example:
var x: num = 123;
if (typeof(x) != num) {
print("This will always print!");
}
Output:
This will always print!
Finished execution with exit code 0.
Expected Behavior
Unequal expressions should result in false.
var x: num = 123;
if (typeof(x) != num) {
print("This should never print");
}
Steps To Reproduce
- Define a variable of any type (ex.
var x: num = 1;)
- Create an
if statement to check if the typeof the previously defined variable is not equal to the type it was defined as (ex. if (x != num) { ... })
Workarounds
Currently, to have functional type checking, you must creating a variable that is solely the typeof the variable you are attempting to check (in this case a num), like so:
var x: num = 123;
var checker: type = typeof(num);
if (x != checker) {
print("Works as expected.");
}
Environment
- Kipper: 0.12.1
- Environment: Vivaldi 7.6.3797.56 (Playground)
- Operating System: Arch Linux
Is there an existing issue for this?
I am following the documentation's guide
This issue exists in the latest version
Current Behavior
Type checking always results in
trueexpressions due to improper brace insertion in the code generator. For example:Output:
Expected Behavior
Unequal expressions should result in
false.Steps To Reproduce
var x: num = 1;)ifstatement to check if thetypeofthe previously defined variable is not equal to the type it was defined as (ex.if (x != num) { ... })Workarounds
Currently, to have functional type checking, you must creating a variable that is solely the
typeofthe variable you are attempting to check (in this case anum), like so:Environment