Gradual typing, proposed by Siek and Taha, is a framework to combine the benefits of static and dynamic typing. In gradual typing, some parts of the program are type-checked at compile-time, and the other parts are type-checked at run-time. So, a programmer can write a program rapidly without static type annotations in the beginning of development, then add type annotations as the development progresses and end up with a fully statically typed program. In this paper, we introduce FJ
? as a theoretical basis of gradual typing for an object-oriented language with a nominal type system. FJ
? is a gradual typing system for Featherweight Java (FJ), a minimal core calculus for Java by Igarashi, Pierce and Wadler. We define FJ
refl, an extension of FJ with reflection, to give translational semantics of FJ
? and show that a certain type safety property holds for FJ
?, even in the presence of dynamically typed program fragments.
View full abstract