Skip to content

Support strict runtime type checking #9

@JukkaL

Description

@JukkaL

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 and bound to a statically-typed variable.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions