Last active
March 3, 2022 07:11
-
-
Save jesperes/4265139e0e8f597ea5d9fd368b6bf8af to your computer and use it in GitHub Desktop.
Dialyzer bug in OTP 24.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(epgsql). | |
-export_type([connect_opts/0]). | |
-type connect_opts() :: foo:bar(). %% unknown type here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(epgsql_cmd_connect). | |
-export([open_socket/1]). | |
%% ... no code at line 3 ... | |
-spec open_socket(epgsql:connect_opts()) -> ok. | |
open_socket(_ConnectOpts) -> | |
ok. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./run.sh | |
+ erlc +debug_info epgsql_cmd_connect.erl epgsql.erl | |
+ dialyzer epgsql.beam epgsql_cmd_connect.beam --plt /home/jespereskilson/dev/kred/build/otp.plt --no_check_plt | |
Proceeding with analysis... | |
Unknown types: | |
foo:bar/0 (epgsql.erl:3:25) | |
foo:bar/0 (epgsql_cmd_connect.erl:3:25) | |
done in 0m0.57s | |
done (passed successfully) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -x | |
erlc +debug_info *.erl | |
dialyzer *.beam --plt ~/dev/kred/build/otp.plt --no_check_plt |
OTP versions prior to 24 are not affected. All OTP 24.x-25.x versions are affected.
To reproduce this error, use "download zip", unpack it locally, and run the run.sh
script.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dialyzer reports two errors, but the second one is wrong.
The first one is correct, as the type
foo:bar()
does not exist.-spec open_socket(epgsql:connect_opts()) -> ok.
does not refer to an unknown type.