Before OTP-26 this:
resulted in no warning from dialyzer. On 26 I get the warning the attribute is meant to silence:
apps/opentelemetry/src/otel_resource_detector.erl
Line 200 Column 9: Unknown function release_handler:which_releases/1
Before I open an isusue on the OTP repo I figured I’d check here if I’m just missing something…
Note that there are many other uses of -dialyzer
in the project but they do not fail.
–
I’m also seeing warnings from dependencies…
_build/default/lib/ctx/src/ctx.erl
Line 21 Column 28: Unknown type timer:time/0
Line 21 Column 42: Unknown type timer:time/0
But not sure yet if thats an issue in dialyzer or rebar3, but noting here in case others are seeing this as well.
1 Like
The last one is because Dialyzer switched to having the unknown
option as a default; the timer:time/0
type is unexported but the ctx library has a fix in main about that (Type timer:time() is not exported from timer module · tsloughter/ctx@e3acf4d · GitHub ).
I have added support for the no_unknown
option in my Rebar3 PR (OTP-26-rc1 support: Fix incremental dialyzer usage, and make it even more incremental by ferd · Pull Request #2774 · erlang/rebar3 · GitHub ) – which strips it in older Dialyzer versions to avoid errors for compatibility.
2 Likes
Thanks.
And for others reading this I’ll note here we discussed elsewhere that the -dialyzer({nowarn...
should work to silence that warning, instead of having to disable unknown
entirely with no_unknown
, so I guess I’ll be opening an issue on the Erlang repo later today.
1 Like
kiko
March 8, 2023, 11:20am
4
Thanks for opening the issue. I am looking into it
1 Like
kiko
March 14, 2023, 2:00pm
5
this PR should fix it. Merging tomorrow if it passes all tests (which it does locally)
erlang:master
← kikofernandez:kiko/dialyzer/fix-nowarning_function/GH-6942/OTP-18439
opened 02:24PM - 09 Mar 23 UTC
skip warnings about functions that have inlined nowarn_function flags, e.g.,
… ```erlang
-dialyzer({nowarn_function, find_release/0}).
find_release() ->
non_existing_function:foo().
```
closes GH-6942
3 Likes