switch (true) {
case 1 < 0:
console.log('hanni');
break;
case 0 < 1:
console.log('nanni');
break;
}
NodeJS:
$ node switch.js
nanni
Nectar:
$ nectar --run switch.js
[*] Generating source file
[*] Compiling with preset: speed
/Users/pestix/dumpster/nectar/.nectar/7j0o0/switch.cpp:322:1: error: multiple conversions from switch condition type 'NectarCore::VAR' to an integral or enumeration type
switch (__Nectar_Boolean_TRUE) {
^ ~~~~~~~~~~~~~~~~~~~~~
/Users/pestix/dumpster/nectar/.nectar/7j0o0/var_header.h:191:3: note: conversion to integral type 'int'
operator int();
^
/Users/pestix/dumpster/nectar/.nectar/7j0o0/var_header.h:195:3: note: conversion to integral type 'bool'
operator bool();
^
/Users/pestix/dumpster/nectar/.nectar/7j0o0/var_header.h:199:3: note: conversion to integral type 'long long'
operator long long();
NodeJS:
Nectar: