This seems like a really easy problem to avoid by simply having a better type system and knowing how to use it. namely just have the take! function return an optional map where it returns Some(map) if the map has the expected keys and None if the map it would have returned in the non-asserting version wouldn't have been valid (I.e, wouldn't have had the expected keys). Then if you really want to assert on this, you just use .unwrap or .expect.

No, I don't think that a better type system would help with this.

The problem here is that the blog post would be more appropriately titled "How far can we go with compile time evaluation of field symbols [0]?" Field symbols and collections of field symbols would need to be a first class feature in the language whose compile time evaluation is well defined.

[0] symbols = think Ruby symbols

> just have the take! function return an optional map

A map of what ?