plt/racket — pull request #554 by takikawa (2014-01-24 22:41:20+00:00)
Title: Add initial support for classes to Typed Racket

This PR adds initial support for type-checking class expressions in Typed Racket.

Since the development branch has too many commits that are difficult to squash together and rebase, I've rebased an initial portion of the work and will gradually add the rest in.

Things this PR has:
* Type-checking `class` expressions via a macro provided by Typed Racket.
* A new `Class` type that accommodates public methods, fields, named init arguments, overriding, augmenting, and inheriting.
* Some documentation (more needed).
* Many tests.

Things this PR is notably missing:
* Sealing contracts and proper contract generation for objects and mixins. The contract generation in this PR is unsound for certain cases, but these other parts depend on a separate PR I'm going to submit for the core contract system.
* Implicit recursive types via type aliases. Since implicit recursive types involve substantial contract generation work, I've put it off for a future PR. All the key portions are implemented, but it's easier to merge it and do code review for it separately.
* Type annotations for class-based libraries. I have annotations for most of `racket/gui` and other libraries sitting around, but they can't be merged until the previous two bullets are solved.

Future work:
* Support for positional init arguments.
* Support for interfaces.

There are several miscellaneous things that will be merged later too (some occurrence typing support, `get-field` and `set-field!` fixes, etc.).