Skip to main content

Intersection Types in Java: Back to the Future

  • Chapter
  • First Online:
Models, Mindsets, Meta: The What, the How, and the Why Not?

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 11200))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Bettini, L., Bono, V., Dezani-Ciancaglini, M., Giannini, P., Venneri, B.: Java & lambda: a featherweight story. Logical Meth. Comput. Sci. 14(3) (2018)

    Google Scholar 

  2. Büchi, M., Weck, W.: Compound types for Java. In: Freeman-Benson, B.N., Chambers, C. (eds.) OOPSLA, pp. 362–373. ACM (1998)

    Google Scholar 

  3. Coppo, M., Dezani-Ciancaglini, M., Venneri, B.: Functional characters of solvable terms. Math. Logic Q. 27(2–6), 45–58 (1981)

    Article  MathSciNet  Google Scholar 

  4. Davies, R., Pfenning, F.: Intersection types and computational effects. In: Odersky, M., Wadler, P. (eds.) ICFP, pp. 198–208. ACM (2000)

    Google Scholar 

  5. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-oriented Software. Addison-Wesley, Reading (1995)

    MATH  Google Scholar 

  6. Gosling, J., Joy, B., Steele, G.L., Bracha, G., Buckley, A.: The Java Language Specification, Java SE 8 Edition. Oracle (2015)

    Google Scholar 

  7. 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)

    Article  Google Scholar 

  8. Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)

    MATH  Google Scholar 

  9. Pierce, B.C., Turner, D.N.: Local type inference. ACM Trans. Program. Lang. Syst. 22(1), 1–44 (2000)

    Article  Google Scholar 

Download references

Acknowledgements

We would like to thank the anonymous referees for their helpful comments.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Paola Giannini .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics