Closed rodrigues closed 5 years ago
Hmmmmm. Seems like it's choking at the Dialyzer call in that stacktrace? But it gives you a warning back in raw? That's really strange to me.
I actually can't reproduce this. What version of Elixir/Erlang are you running?
Running mix dialyzer
on that branch yields
lib/ex_unit_properties.ex:605:invalid_contract
The @spec for the function does not match the success typing of the function.
Function:
ExUnitProperties.pick/1
Success typing:
@spec pick(atom() | tuple() | %StreamData{:generator => (_, _ -> any()), _ => _}) :: any()
________________________________________________________________________________
lib/stream_data.ex:252:extra_range
Type specification has too many types.
Function:
StreamData.constant/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:278:extra_range
Type specification has too many types.
Function:
StreamData.map/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:338:extra_range
Type specification has too many types.
Function:
StreamData.bind_filter/3
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:344:call
The function call will not succeed.
StreamData.bind_filter(_data :: any(), (_, _ -> any()), _max_consecutive_failures :: any())
breaks the contract
(t(97), (97 -> {:cont, t(98)} | :skip), non_neg_integer()) :: t(98)
when a: term(), b: term()
________________________________________________________________________________
lib/stream_data.ex:428:extra_range
Type specification has too many types.
Function:
StreamData.bind/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:478:extra_range
Type specification has too many types.
Function:
StreamData.filter/3
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:507:extra_range
Type specification has too many types.
Function:
StreamData.integer/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(integer()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:562:extra_range
Type specification has too many types.
Function:
StreamData.resize/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:589:extra_range
Type specification has too many types.
Function:
StreamData.sized/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:630:extra_range
Type specification has too many types.
Function:
StreamData.scale/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:656:extra_range
Type specification has too many types.
Function:
StreamData.unshrinkable/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:683:extra_range
Type specification has too many types.
Function:
StreamData.seeded/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:737:extra_range
Type specification has too many types.
Function:
StreamData.frequency/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:769:extra_range
Type specification has too many types.
Function:
StreamData.one_of/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:791:extra_range
Type specification has too many types.
Function:
StreamData.member_of/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:855:extra_range
Type specification has too many types.
Function:
StreamData.list_of/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t([any()]) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:995:extra_range
Type specification has too many types.
Function:
StreamData.uniq_list_of/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t([any()]) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1094:extra_range
Type specification has too many types.
Function:
StreamData.nonempty_improper_list_of/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1125:extra_range
Type specification has too many types.
Function:
StreamData.maybe_improper_list_of/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1150:extra_range
Type specification has too many types.
Function:
StreamData.fixed_list/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t([any()]) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1178:extra_range
Type specification has too many types.
Function:
StreamData.tuple/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(tuple()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1208:extra_range
Type specification has too many types.
Function:
StreamData.map_of/3
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1241:extra_range
Type specification has too many types.
Function:
StreamData.fixed_map/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1274:extra_range
Type specification has too many types.
Function:
StreamData.optional_map/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(map()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1322:extra_range
Type specification has too many types.
Function:
StreamData.keyword_of/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(Keyword.t()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1347:extra_range
Type specification has too many types.
Function:
StreamData.mapset_of/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1369:extra_range
Type specification has too many types.
Function:
StreamData.nonempty/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1417:extra_range
Type specification has too many types.
Function:
StreamData.tree/2
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1465:extra_range
Type specification has too many types.
Function:
StreamData.boolean/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(boolean()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1487:extra_range
Type specification has too many types.
Function:
StreamData.integer/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(integer()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1507:extra_range
Type specification has too many types.
Function:
StreamData.positive_integer/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(pos_integer()) | %StreamData{:generator => (_, _ -> map())}
________________________________________________________________________________
lib/stream_data.ex:1536:extra_range
Type specification has too many types.
Function:
StreamData.float/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1612:extra_range
Type specification has too many types.
Function:
StreamData.byte/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(integer()) | StreamData.t(byte())
________________________________________________________________________________
lib/stream_data.ex:1645:extra_range
Type specification has too many types.
Function:
StreamData.binary/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1679:extra_range
Type specification has too many types.
Function:
StreamData.bitstring/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1745:extra_range
Type specification has too many types.
Function:
StreamData.string/1
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1873:extra_range
Type specification has too many types.
Function:
StreamData.iolist/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1898:extra_range
Type specification has too many types.
Function:
StreamData.iodata/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
lib/stream_data.ex:1936:extra_range
Type specification has too many types.
Function:
StreamData.term/0
Extra type:
atom() | tuple()
Success typing:
StreamData.t(_)
________________________________________________________________________________
done (warnings were emitted)
@asummers did you do that with elixir 1.9, otp 22?
Just tried again, mix dialyzer
fails like that, and mix dialyzer --format raw
works 🤔
also hitting this on arch linux: OTP 22, erts 10.4.1, elixir 1.8.2
Seems like an OTP 22 thing then. Will investigate. Works perfectly on 21 for me.
Seems like it's unhappy with this spec:
@spec bind_filter(t(a), (a -> {:cont, t(b)} | :skip), non_neg_integer()) :: t(b)
when a: term(),
b: term()
If the a
and b
are changed to term()
in the spec, it's happy, but still trying to investigate root cause.
This is seemingly fixed in Erlang master. Once they drop a new patch release this should be fixed for you. Nothing I can do on my end for it. I believe it was fixed by this commit:
https://github.com/erlang/otp/commit/dd9a4d6f559cac28fd74dac0ff62d27bfed66e64
Yes, just tested now with otp 22.0.5
and it works 👍🏼
In this fork of
stream_data
(branch:dialyxir
), I added dialyxir to its deps and tried running it, getting this failure instead:If I run it with
--format raw
, it works: