Preventing errors with compile-time checking of types