diff options
author | Hans Bolinder <[email protected]> | 2018-02-23 12:45:26 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2018-02-23 12:45:26 +0100 |
commit | fe19dd4829cbb4014847ac4296e063c205aa93f8 (patch) | |
tree | 4535e578440b7150ea7bc259568985a34547c6c1 /lib/dialyzer/test | |
parent | 897c82097348b33383e62bcf0ecc236132d7a2cc (diff) | |
parent | b3fd7dc1b52520065e9dc977195608baf1f206ce (diff) | |
download | otp-fe19dd4829cbb4014847ac4296e063c205aa93f8.tar.gz otp-fe19dd4829cbb4014847ac4296e063c205aa93f8.tar.bz2 otp-fe19dd4829cbb4014847ac4296e063c205aa93f8.zip |
Merge branch 'maint'
* maint:
dialyzer: Correct a parameterized opaque types bug
Diffstat (limited to 'lib/dialyzer/test')
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same.erl | 15 | ||||
-rw-r--r-- | lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same_type.erl | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same.erl b/lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same.erl new file mode 100644 index 0000000000..44149f4199 --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same.erl @@ -0,0 +1,15 @@ +-module(same). + +-export([baz/1]). + +-record(bar, { + a :: same_type:st(integer()), + b :: same_type:st(atom()) + }). + +baz(Bar) -> + _ = wrap_find(0, Bar#bar.a), + wrap_find(0, Bar#bar.b). + +wrap_find(K, D) -> + same_type:t(K, D). diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same_type.erl b/lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same_type.erl new file mode 100644 index 0000000000..855a5d30be --- /dev/null +++ b/lib/dialyzer/test/opaque_SUITE_data/src/para_bug/same_type.erl @@ -0,0 +1,13 @@ +-module(same_type). + +-export([t/2]). + +-export_type([st/1]). + +%% When unopaqued all specializations of st/1 are equal. +-opaque st(_A) :: {st, tuple()}. + +-spec t(_, st(_)) -> _. + +t(K, V) -> + {K, V}. |