Consider
data W
= WithoutField
| WithField with
field : Int
getMyField : W -> Int
getMyField a = a.field
t : Script ()
t = do
let w = WithField 10
debug $ getMyField w
let wo = WithoutField
debug $ getMyField wo
The code above compiles, but the script will fail with an error.
- AFAIK, there’s no way to turn this into an error, and I can’t find a warning. Is that correct?
- Is there any way to statically check for usage of missing record selectors? I know that I (
) would never write such code, so asking for a friend.