-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
demands and ensures maybe, but what does rescue look like? invariant seems pointless.
Does anything apply to closures specifically?
Something like:
const squareContract = new FunctionContract<typeof square>({
demands(x) { return typeof x == 'number' },
ensures(result, [x]) { return result >= x }
})
@Contracted(squareContract)
function square(x){ return x**2 }rajasegar
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request