Safely Emulating Dynamic Dispatch

How you can use sealed classes and sealed interfaces to safely emulate dynamic dispatch by turning runtime errors into compile-time errors.

Gabriel Shanahan
The Kotlin Primer
Published in
4 min readSep 18, 2022

--

— — — — — — — — — — — — — — —

THE CURRENT VERSION OF THIS ARTICLE IS PUBLISHED HERE.

— — — — — — — — — — — — — — —

--

--