Is Dialyzer fetching incorrect specs, or are they incorrect in Meeseeks?

I code dived a bit. And on a first glance everything looks like passing in a string should work (and actually does).

But, this string gets passed (deep in the stack of function calls) to MeeseeksHtml5ever.Native.parse_html/1. As you can guess from its name, its a NIF.

NIFs always have two implemantations. A native one (eg.: C or Rust) and a “naive” one (BEAM-compatible). Often the naive one is simply throwing.

This throw does happen as well for this function (check meeseeks_html5ever/lib/meeseeks_html5ever/native.ex at main · mischov/meeseeks_html5ever · GitHub).

This is the only implementation dialyzer sees. So from dialyzers view, passing a string to Meeseex.parse/1 will always resuilt in a throw, so dialyzer removes String.t silently from the spec.

This has to be fixed upstream (meeseex_html5ever).