Good Enough Types: Heuristic Type Inference for Ruby
What if you could get type information without writing type annotations?
type-guessr is a Ruby LSP addon that reverses duck typing. Instead of "if it responds to these methods, it's OK," we reason: "if these methods were called, it must be this class."
For example, if ingredients and steps are called on a variable, and only the Recipe class has both methods, we infer the type as Recipe.
In this talk, I'll share how it works in practice, its algorithm design, and the limits of this approach.