Roldak / SFSL

Statically typed Functionnal Scripting Language
1 stars 0 forks source link

Don't report errors if then and else parts of an if expression have different types if the expected type is unit #95

Closed Roldak closed 8 years ago

Roldak commented 8 years ago

Right now this is necessary:

if cmp(key, k) {
    right = right.insert(k, v);
    ();
} else if cmp(k, key) {
    left = left.insert(k, v);
    ();
} else {
    val = v;
    ();
}
this;

But this would be way better:

if cmp(key, k) {
    right = right.insert(k, v);
} else if cmp(k, key) {
    left = left.insert(k, v);
} else {
    val = v;
}
this;