Lune

OOPSLA2022Top-tier venue

A case for DOT: theoretical foundations for objects with pattern matching and GADT-style reasoning

Aleksander Boruch-Gruszecki, Radoslaw Wasko, Yichen Xu, Lionel Parreaux

Abstract

Many programming languages in the OO tradition now support pattern matching in some form. Historical examples include Scala and Ceylon, with the more recent additions of Java, Kotlin, TypeScript, and Flow. But pattern matching on generic class hierarchies currently results in puzzling type errors in most of these languages. Yet this combination of features occurs naturally in many scenarios, such as when manipulating typed ASTs. To support it properly, compilers needs to implement a form of subtyping reconstruction: the ability to reconstruct subtyping information uncovered at runtime during pattern matching. We introduce cDOT, a new calculus in the family of Dependent Object Types (DOT) intended to serve as a formal foundation for subtyping reconstruction. Being descended from pDOT, itself a formal foundation for Scala, cDOT can be used to encode advanced object-oriented features such as generic inheritance, type constructor variance, F-bounded polymorphism, and first-class recursive modules. We demonstrate that subtyping reconstruction subsumes GADTs by encoding λ 2, G µ , a classical constraint-based GADT calculus, into cDOT.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. When Subtyping Constraints Liberate: A Novel Type Inference Approach for First-Class PolymorphismLionel Parreaux, Aleksander Boruch-Gruszecki, Andong Fan, Chun Yin ChauPOPL 2024 · 13 citations
  2. Gradient: Gradual Compartmentalization via Object Capabilities Tracked in TypesAleksander Boruch-Gruszecki, Adrien Ghosn, Mathias Payer, Clément Pit-ClaudelOOPSLA 2024 · 1 citation

Builds on1

  1. Undecidability of d<: and its decidable fragmentsJason Z. S. Hu, Ondrej LhotákPOPL 2020 · 9 citations

Related papers

  1. ιDOT: a DOT calculus with object initializationIfaz Kabir, Yufeng Li, Ondrej LhotákOOPSLA 2020 · 3 citations
  2. Recursive Subtyping for AllLitao Zhou, Yaoda Zhou, Bruno C. d. S. OliveiraPOPL 2023 · 8 citations
  3. The Essence of Generalized Algebraic Data TypesFilip Sieczkowski, Sergei Stepanenko, Jonathan Sterling, Lars BirkedalPOPL 2024 · 7 citations
  4. Modular Type Safety for Traits with Extensible Variants and Deep Pattern MatchingAndong Fan, Lionel Parreaux, Ningning XieOOPSLA 2026
  5. Greedy Implicit Bounded QuantificationChen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraOOPSLA 2023 · 9 citations
Dusk over the sea between two cliffs drawn in fine vertical lines