Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 427 Bytes

README.md

File metadata and controls

23 lines (17 loc) · 427 Bytes

scala-dynamic-typing

Proof of concept String interpolator macro for runtime failure of typechecking.

Usage

typechecks fine

case class Cat(name: String, age: Int)
val myCat = Cat("Fluf", 10)
val age = dyn"myCat.age"
age === 10

fails typecheck at runtime with a compiler warning

case class Cat(name: String, age: Int)
val myCat = Cat("Fluf", 10)
val age = dyn"myCat.breed"
age === 10