diff options
author | Hans Bolinder <[email protected]> | 2019-05-07 08:25:56 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2019-05-07 08:25:56 +0200 |
commit | 1a2259e01e8f8e000a1d8f93a9446c996c148325 (patch) | |
tree | 57c71e5fb661d26074b5faf0902fc9625323586e /lib/dialyzer/test/indent_SUITE_data/src/rec/rec_adt.erl | |
parent | fb9cd9534b94fe8c24bc5412205dd97577894b59 (diff) | |
parent | c2cd09c3d6807d2e93d117d9c6b47a706a50c763 (diff) | |
download | otp-1a2259e01e8f8e000a1d8f93a9446c996c148325.tar.gz otp-1a2259e01e8f8e000a1d8f93a9446c996c148325.tar.bz2 otp-1a2259e01e8f8e000a1d8f93a9446c996c148325.zip |
Merge branch 'hasse/dialyzer/prettier_warnings/OTP-15135'
* hasse/dialyzer/prettier_warnings/OTP-15135:
dialyzer: Remove quotes around operators
dialyzer: Add test cases with indentation
dialyzer: Add an --no_indentation option
dialyzer: Add parentheses around annotated union elements
dialyzer: Fix dialyzer_dataflow:format_args_1()
Diffstat (limited to 'lib/dialyzer/test/indent_SUITE_data/src/rec/rec_adt.erl')
-rw-r--r-- | lib/dialyzer/test/indent_SUITE_data/src/rec/rec_adt.erl | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/dialyzer/test/indent_SUITE_data/src/rec/rec_adt.erl b/lib/dialyzer/test/indent_SUITE_data/src/rec/rec_adt.erl new file mode 100644 index 0000000000..f01cc5e519 --- /dev/null +++ b/lib/dialyzer/test/indent_SUITE_data/src/rec/rec_adt.erl @@ -0,0 +1,22 @@ +-module(rec_adt). + +-export([new/0, get_a/1, get_b/1, set_a/2, set_b/2]). + +-record(rec, {a :: atom(), b = 0 :: integer()}). + +-opaque rec() :: #rec{}. + +-spec new() -> rec(). +new() -> #rec{a = gazonk, b = 42}. + +-spec get_a(rec()) -> atom(). +get_a(#rec{a = A}) -> A. + +-spec get_b(rec()) -> integer(). +get_b(#rec{b = B}) -> B. + +-spec set_a(rec(), atom()) -> rec(). +set_a(R, A) -> R#rec{a = A}. + +-spec set_b(rec(), integer()) -> rec(). +set_b(R, B) -> R#rec{b = B}. |