Invalid undefined value warnings
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
vitamin |
New
|
Low
|
Nikos Mouchtaris |
Bug Description
Btw, reminder για τα λάθος "undefined value used" warnings:
// ---
// a lambda "returning" "undefined"
p = lambda (...) { std::print(..., "\n") };
p(9);
// ---
// "undefined" itself... (this libfunc should be removed, as i've said before)
std::undefined()
// ---
// for some reason I don't understand...
function f {
std::print(); // "returns" undefiend
return []; // returns object
}
f(); // using "undefined" value error
Όπως είπα και σε προηγούμενο mail, το "reading" του undefined πιστεύω
πρέπει να είναι runtime error. Το concept του "undefinition
propagation" είναι λίγο περίεργο.
Επίσης, το concept του "undefining" είναι αμφιβόλου χρησιμότητας (δεν
καλύπτονται τα πάντα από το nullification?). Είναι σίγουρα όμως λάθος
τακτική το "undefinition" μέσω "assignment" (x = std::undefined()). Θα
ήταν προτιμότερο να υπάρχει ένα libfunc std::undefine(var), το οποίο
να κάνει undefine μία variable.
Third case solved.
This should become a regression test.