Secrets of the Scala Type System
summary
Concrete rules and failure modes for Scala 3 type lookup: intersection results intersect return types, linearization order decides overrides, union types refuse to synthesize members so union types do not merge members and cause errors unless a common base exists, wildcards cannot be naively substituted and the compiler models them by introducing temporaries and representing type parameters as path‑dependent members so wildcard substitution uses temporary vals, with a demonstrated array mutation crash motivating the design; content draws on Scala 3 compiler work and a PhD formalization.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:13Member lookup - Type argument in prefix
- 3:05Intersection types - Member lookup
- 5:04Scala 2 Compound type - Member lookup
- 6:18Linearization: when inheritance order matters
- 9:13Linearization: more complex example
- 11:03Union types - Member lookup
- 15:44Wildcards - Member lookup
- 16:38Wildcards -Member lookup - Substitution counter example
- 20:23Type members - Member lookup - Skolemization
- 25:40The wildcard trick - Example
related talks
49mThe Trouble With Types
48mA gentle introduction to type level programming in Scala
44mType Parameter Power Up Variance Bounds and Inference
42mLet the Compiler Help You: How to Make the Most of Scala's Type System
44mType level Computations in Scala
30mConstraint Typing with Boolean Algebra
44mTelling the Truth with Types
43mType Clash: When Structural and Nominal Systems Collide
