Sometimes, the code you have isn't the code you wish you had. This is especially true when doing static analyses, or interactive, incremental compilation in an IDE setting. As it turns out, most code does not parse or typecheck when it is being edited.
The PPA project (published at OOPSLA 2008; pdf; ACM) describes a number of semantic "guesses" to infer/recover a partial program's types. In this work, the focus is on recovering types from one file torn asunder from a repository. It is implemented with Soot and Polyglot. It could obviously be extended to handle single or multiple methods disconnected from their class. I think this work would be great inside of an IDE, when most of the point of online compiler feedback is to keep fresh information for code search (which is already imprecise), or simple syntax-based code highlighting.















