Closures written in a few ways reach C unchecked #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three ways a closure can be written that sexc lets through to C, which then refuses it:
A bare function converts to a closure where one is expected in a var initializer, an argument and a return, but not in an assignment or a brace initializer, which reach C as they are:
Function-values.orgsays the conversion fires nowhere else, by design; but a sum constructor does convert its arguments, so the rule is uneven.A
fntype written unwrapped in a closure's argument list is read as a list of words:Wrapped,
(((fn ((int)) int)) (int)), it works, as a typedef does. That is the convention for every argument, but the mistake is reported by C, about the generated struct.(closure () int)written where a closure value belongs, its captures list forgotten, is taken for a type:Found with sexc 35604ad, probing corner cases the test suite does not cover; the rest of what that turned up is fixed on
more-tests-and-corner-cases.