JukkaL/alore — Issue #9: Support strict runtime type checking
Author: JukkaL
Created: 2011-10-11 10:00:55+00:00
State: open

Currently the implementation ignores type annotations when running programs. This means that when assigning value of type "dynamic" to a statically-typed variable, there is no check that the type is correct. Implement an alternative mode where cases like these are checked.

There are basically two ways of doing this:
* Only check the "ground" type. Do not add wrappers. For generic types, ignore the type arguments -- for example, if the target type is Array, only check that the instance is of type Array, but check the item types only when they are accessed.
* Add wrappers that add type checks lazily, similar to gradual typing. This would allow type safety for generics (reified generics). The conceptual difference between the above is that now the object itself does the checking (the wrapper does it), not the client.