currently one can do arbitrary ‘is a’ checks; however, for many combinations of expressions and types we can determine statically that this will always return false, i.e. if the type of the expression is not a supertype of the checked type. The editor/compiler should at least give a warning in such cases, or perhaps we can make this an error.

Constraint:

check : |[ e is a T ]| -> $[type of e should be supertype of T]

where require( e is supertype of T)

Submitted by Eelco Visser on 1 July 2010 at 13:01

Log in to post comments