TypL icon indicating copy to clipboard operation
TypL copied to clipboard

Specific type exceptions

Open getify opened this issue 5 years ago • 0 comments

Type exceptions: allow more fine-grained control over which errors you see. For example:

var x = 42;
var y = "foo";
var z = [1,2,3];

if (x) { .. }   // error about boolean coercion (number -> bool)
if (y) { .. }   // error about boolean coercion (string -> bool)
if (z) { .. }   // no error about this boolean coercion (object -> bool)

getify avatar Feb 20 '19 03:02 getify