TypL
TypL copied to clipboard
Specific type exceptions
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)