These are features that you might want to implement in addition to the core features.
One problem is that type error recovery can generate false errors. For instance our compiler usually considers that the type for incorrect constructs is
Int, which can create cascades of errors:"666" = if 000 then 333 else "666"
File 4.39: is_devil.tig$ tc -T is_devil.tig is_devil.tig:1.9-34: type mismatch then clause type: int else clause type: string is_devil.tig:1.1-34: type mismatch left operand type: string right operand type: int
Example 4.48: tc -T is_devil.tig
One means to avoid this issue consists in introducing a new type,
type::Error, that the type checker would never complain about. This can be a nice complement to
See TC-D, Removing the syntactic sugar from the Abstract Syntax Tree, for more details. This is quite an easy option, and a very interesting one. Note that implementing desugaring makes TC-5 easier.
If you felt TC-D was easy, then implementing bounds checking should be easy too. See TC-B, Array bounds checking.
See TC-A, Ad Hoc Polymorphism (Function Overloading), for a description of this ambitious option.
Renaming object-oriented constructs
Like TC-R, this task consists in writing a visitor renaming AST nodes holding names (either defined or used), this time with support for object-oriented constructs (option
--object-rename). This visitor,
object::Renamer, shall also update named types (
type::Named) and collect the names of all (renamed) classes. This option is essentially a preliminary step of TC-O (see the next item).
Desugaring Tiger to Panther
If your compiler is complete w.r.t. object constructs (in particular, the type-checking and the renaming of objects is a requirement), then you can implement this very ambitious option, whose goal is to convert a Tiger program with object constructs into a program with none of them (i.e., in the subset of Tiger called Panther). This work consists in completing the
object::DesugarVisitorand implementing the
--object-desugaroption. See TC-O, Desugaring object constructs.