Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce the attribute -optional_callbacks in the context of behaviours
- Loading branch information
Showing
29 changed files
with
611 additions
and
134 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
with_bad_format_status.erl:12: The inferred type for the 1st argument of format_status/2 ('bad_arg') is not a supertype of 'normal' | 'terminate', which is expected type for this argument in the callback of the gen_server behaviour |
12 changes: 12 additions & 0 deletions
12
lib/dialyzer/test/small_SUITE_data/src/behaviour_info/with_bad_format_status.erl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-module(with_bad_format_status). | ||
|
||
-behaviour(gen_server). | ||
-export([handle_call/3,handle_cast/2,handle_info/2, | ||
code_change/3, init/1, terminate/2, format_status/2]). | ||
handle_call(_, _, S) -> {noreply, S}. | ||
handle_cast(_, S) -> {noreply, S}. | ||
handle_info(_, S) -> {noreply, S}. | ||
code_change(_, _, _) -> {error, not_implemented}. | ||
init(_) -> {ok, state}. | ||
terminate(_, _) -> ok. | ||
format_status(bad_arg, _) -> ok. % optional callback |
13 changes: 13 additions & 0 deletions
13
lib/dialyzer/test/small_SUITE_data/src/behaviour_info/with_format_status.erl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-module(with_format_status). | ||
|
||
-behaviour(gen_server). | ||
-export([handle_call/3,handle_cast/2,handle_info/2, | ||
code_change/3, init/1, terminate/2, format_status/2]). | ||
-export([handle_call/3,handle_cast/2,handle_info/2]). | ||
handle_call(_, _, S) -> {noreply, S}. | ||
handle_cast(_, S) -> {noreply, S}. | ||
handle_info(_, S) -> {noreply, S}. | ||
code_change(_, _, _) -> {error, not_implemented}. | ||
init(_) -> {ok, state}. | ||
terminate(_, _) -> ok. | ||
format_status(normal, _) -> ok. % optional callback |
Oops, something went wrong.