plt/racket — pull request #825 by takikawa (2014-11-15 01:32:31+00:00)
Title: Typecheck the #:guard clause of typed structs

This PR turns on typechecking for the `#:guard` clause of structs which were silently ignored before.

It's a fairly minimal change that primarily only required changes at the frontend macro level. The limitation of this approach is that it doesn't let the guard expression change the type of the struct fields, which you could potentially do by making the typechecker aware of struct guards (use the result type of the guard as the field types basically). I doubt that that's a common use case.

Also, there's a lot of code duplication in the implementation of `define-struct` that I intend to eventually factor out.