Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Dialyzer is such a weird beast, it's overly optimistic IMO. We have code that almost literally is

    -record(outside_error, {
        reason :: term()
    }).

    -record(inside_error, {
        reason :: binary()
    }).

    -spec to_inside_error(#outside_error{}) -> #inside_error{}.
    to_inside_error(#outside_error{reason = Reason}) ->
        #inside_error{reason = Reason}.
and it typechecks just fine. I mean, yeah, we actually always used to have binaries in #outside_error—until now. Now we've started to sometimes pass a map in it. And so, somewhere down the line calls to unicode:binary_to_characters/1 suddenly start crashing because a map is not a binary, duh, but! it all still typechecks. Amazing.


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: