Abstract
In this paper we figure out the future of intersection types in Java developments, based both on the primary meaning of the intersection type constructor and on the present approach in Java. In our vision, the current use of intersection types will be extended in two directions. Firstly, intersections will be allowed to appear as types of fields, types of formal parameters and return values of methods, therefore they will be significantly used as target types for \(\lambda \)-expressions anywhere. Secondly, the notion of functional interface will be extended to any intersection of interfaces, including also several abstract methods with different signatures. Thus a single target type will be able to express multiple, possibly unrelated, properties of one \(\lambda \)-expression.
We formalise our proposal through a minimal Java core extended with these novel features and we prove the type safety property.
Mariangiola Dezani-Ciancaglini—Partially supported by EU H2020-644235 Rephrase project, EU H2020-644298 HyVar project, IC1402 ARVI and Ateneo/CSP project RunVar.
Paola Giannini—This original research has the financial support of the Università del Piemonte Orientale.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Bettini, L., Bono, V., Dezani-Ciancaglini, M., Giannini, P., Venneri, B.: Java & lambda: a featherweight story. Logical Meth. Comput. Sci. 14(3) (2018)
Büchi, M., Weck, W.: Compound types for Java. In: Freeman-Benson, B.N., Chambers, C. (eds.) OOPSLA, pp. 362–373. ACM (1998)
Coppo, M., Dezani-Ciancaglini, M., Venneri, B.: Functional characters of solvable terms. Math. Logic Q. 27(2–6), 45–58 (1981)
Davies, R., Pfenning, F.: Intersection types and computational effects. In: Odersky, M., Wadler, P. (eds.) ICFP, pp. 198–208. ACM (2000)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley, Reading (1995)
Gosling, J., Joy, B., Steele, G.L., Bracha, G., Buckley, A.: The Java Language Specification, Java SE 8 Edition. Oracle (2015)
Igarashi, A., Pierce, B.C., Wadler, P.: Featherweight Java: a minimal core calculus for Java and GJ. ACM Trans. Program. Lang. Syst. 23(3), 396–450 (2001)
Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)
Pierce, B.C., Turner, D.N.: Local type inference. ACM Trans. Program. Lang. Syst. 22(1), 1–44 (2000)
Acknowledgements
We would like to thank the anonymous referees for their helpful comments.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this chapter
Cite this chapter
Dezani-Ciancaglini, M., Giannini, P., Venneri, B. (2019). Intersection Types in Java: Back to the Future. In: Margaria, T., Graf, S., Larsen, K. (eds) Models, Mindsets, Meta: The What, the How, and the Why Not?. Lecture Notes in Computer Science(), vol 11200. Springer, Cham. https://doi.org/10.1007/978-3-030-22348-9_6
Download citation
DOI: https://doi.org/10.1007/978-3-030-22348-9_6
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-22347-2
Online ISBN: 978-3-030-22348-9
eBook Packages: Computer ScienceComputer Science (R0)