Mqx
Mqx13mo ago

Deno type enforcement

Hey, I have a question about the type checking.
function logging(message : number) {
console.log(message);
}

logging(“Hello”);
function logging(message : number) {
console.log(message);
}

logging(“Hello”);
This should throw an error when trying to run it, but apparently it does not. But why? We tried using the tsc compiler from Node and it clearly throws an error, saying that the type string is not assignable to type number. Is there something I need to change in the config for Deno to get the same error result? Thanks ~Mqx
1 Reply
Mqx
Mqx13mo ago
Ohh found out that type checking is off by default and I need to use the —check flag