Inference, Targeting and Compatibility in a Type System for Java with SAM Typed Closures

Abstract

In this paper we consider the new type structure that has been proposed for Java closures, in the last Java Specification Language [BS11a]. This structure uses SAM types that are in fact, nominal types instead of the structural, functional types, used in the previous, proposals. In addition, it allows type inference for closures and for closure arguments. Through a technique, already consolidated in previous studies in Java extensions, we extend the calculus FGJ, [IPW01], with interfaces, anonymous classes, closures of the new form and SAM types. We define a type system and a reduction semantics for this calculus FGATCJ. Using the type system, we formalize the notions of closure context, target type, compatibility type and closure type as they emerge in [BS11a]. Eventually, we prove the soundness of the type system.

Extracted Key Phrases

6 Figures and Tables

Cite this paper

@inproceedings{Bellia2012InferenceTA, title={Inference, Targeting and Compatibility in a Type System for Java with SAM Typed Closures}, author={Marco Bellia and M. Eugenia Occhiuto}, booktitle={CS&P}, year={2012} }