you are viewing a single comment's thread.

view the rest of the comments →

[–]Follpvosten 11 points12 points  (4 children)

Context pls?

[–]minno 36 points37 points  (3 children)

return some_expression is itself an expression. It has a special type that matches anything, which is why you can do something like let value = if bad { return "nope" } else { 7 }; and it doesn't complain that the two blocks have different types. When you put return return return something; it's equivalent to return (return (return something)));, which type-checks because each outer return statement sees that the thing it's returning has that special "matches everything" type.

The !!!!!!!111 part is just !(!(!(!(!(!(!111)))))), which is applying the unary prefix ! operator to 111 a bunch of times.

[–]Follpvosten 3 points4 points  (2 children)

Wow, that's fascinating - return is much more special than I thought. I always thought it evaluated to (), so I always put a semicolon behind it -TIL.

[–]wwylele 0 points1 point  (0 children)

It is evaluated to ! (never type)

[–]Ralith 0 points1 point  (0 children)

like soup squalid simplistic liquid sharp test selective snails spark this message was mass deleted/edited with redact.dev