Abstract

Object-oriented languages with multiple dispatch and multiple inheritance provide rich expressiveness but statically and modularly checking programs in such languages to guarantee that no ambiguous calls can occur at run time has been a difficult problem. We present a core calculus for Fortress, which provides various language features-notably functional methods and components- and solves the problem. Functional methods are declared within traits and may be inherited but are invoked by ordinary function calls, and therefore compete in overloading resolution with ordinary function declarations. A novel component system governs visibility of types and functions, and allows fine-grained control over the import of overloaded functions. We formally define the type system of Fortress with a set of static rules to guarantee no ambiguous calls at run time, and mechanize the calculus and its type safety proof in Coq.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call