Static Typing for Dynamic Messages
Abstract
Dynamic messages are first-class messages dynamically bound to program variables. By dynamic messages, the methods to be invoked can be varied dynamically at run-time, which provides a powerful abstraction mechanism for object-oriented languages. Dynamic messages are critically needed for some programs, but it seems that there has been no proposal of static type systems for dynamic messages. This paper presents a static typing discipline for dynamic messages and formalizes it into a second order polymorphic type system. The type system satisfies the type soundness property and has a principal type inference algorithm. The type system therefore provides a foundation for a statically typed object-oriented language enriched with polymorphic dynamic messages.