Conference paper
Cite …

Towards Virtual Traits in Scala

Manuel Weiel, Ingo Maier, Sebastian Erdweg ORCID iD icon 1, Michael Eichberg and Mira Mezini
1 Institute for Program Structures and Data Organisation (IPD), Karlsruhe Institute of Technology (KIT)
Abstract

Scala is a powerful language that supports a variety of fea- tures, but it lacks virtual traits. Virtual traits are class- valued object attributes and can be redefined within sub- traits. They support higher-order hierarchies and family polymorphism. This work introduces virtual traits into Scala and explains how to encode virtual traits on top of existing Scala features. We have implemented this encoding using Scala annotation macros and have conducted two small case studies.