Integer? ii = argStock(u);
if (exists ii) {
for (Integer t in 0..ii) {
assert (is Integer tt = days[t]);
sum += tt;
}
return sum;
}
else {
return null;
}
Integer? ii =
argStock(u);
if (is
Null ii) {
return null;
}
else {
for (Integer t
in 0..ii) {
assert (is Integer
tt =
days[t]);
sum +=
tt;
}
return
sum;
}
shared Integer? dayPosition(Stock
u) {
if (exists ii = argStock(u)) {
return sum(days[0..ii]);
} else {
return null;
}
}
Why in else (see picture) ceylon can't deduce ii is not null? Even C# can.
--
You received this message because you are subscribed to the Google Groups "ceylon-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceylon-users...@googlegroups.com.
To post to this group, send email to ceylon...@googlegroups.com.
Visit this group at http://groups.google.com/group/ceylon-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceylon-users/49990c00-1d24-4f20-a4fa-b090edbe95ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.