JSR-000335 Lambda Expressions for the Java Programming Language - Early Draft Review: Lambda Specification
- A. Buckley, D. Smith
- Version 0.4.2. Oracle Corporation, December
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.