HomePhorge

(PUP-2314) Make assert_type handle lambda and user handling
0203eebe0ca0Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-2314) Make assert_type handle lambda and user handling

This adds the ability to handle a Callable as the value, as well
as supporting a lambda that takes over the built in raising of
an error. This means that assert_type can be customized to fail
with special message, or to issue a warning and use a default.

assert_type(String, 1) |$expected, $actual| {

warning("a $actual is not a $expected")
"Free Beer, is the default"

}

Details

Provenance
Henrik Lindberg <henrik.lindberg@cloudsmith.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUd78ea2f11ba9: (PUP-2632) Make Type be subtype of Object
Branches
Unknown
Tags
Unknown

Event Timeline

Henrik Lindberg <henrik.lindberg@cloudsmith.com> committed rPU0203eebe0ca0: (PUP-2314) Make assert_type handle lambda and user handling (authored by Henrik Lindberg <henrik.lindberg@cloudsmith.com>).May 21 2014, 9:02 PM