diff options
author | Hans Bolinder <[email protected]> | 2014-06-17 16:29:24 +0200 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2014-06-17 16:29:24 +0200 |
commit | 9572b1c4615e9efc9a7ff53fafc9a32730ae45e4 (patch) | |
tree | 21bf2411cacb5513dc44632cc955134ee50b192c /lib/dialyzer/test/small_SUITE_data/src/literals.erl | |
parent | 584fb6f256f02d48b3c0be9a9462fe7df1b1acb4 (diff) | |
parent | 805f9c89fc01220bc1bb0f27e1b68fd4eca688ba (diff) | |
download | otp-9572b1c4615e9efc9a7ff53fafc9a32730ae45e4.tar.gz otp-9572b1c4615e9efc9a7ff53fafc9a32730ae45e4.tar.bz2 otp-9572b1c4615e9efc9a7ff53fafc9a32730ae45e4.zip |
Merge branch 'maint'
* maint:
[dialyzer] Correct a doc bug introduced in 0b041238
[dialyzer] Use the option 'dialyzer' to control the compiler
[dialyzer] Fix handling of literal records
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src/literals.erl')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/literals.erl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/literals.erl b/lib/dialyzer/test/small_SUITE_data/src/literals.erl new file mode 100644 index 0000000000..abd7033712 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/literals.erl @@ -0,0 +1,33 @@ +-module(literals). + +%% Bad records inside structures used to be ignored. The reason: +%% v3_core:unfold() does not annotate the parts of a literal. +%% This example does not work perfectly yet, in particular Maps. + +-export([t1/0, t2/0, t3/0, t4/0, m1/1, m2/1, m3/1, m4/1]). + +-record(r, {id :: integer}). + +t1() -> + #r{id = a}. % violation + +t2() -> + [#r{id = a}]. % violation + +t3() -> + {#r{id = a}}. % violation + +t4() -> + #{a => #r{id = a}}. % violation found, but t4() returns... (bug) + +m1(#r{id = a}) -> % violation + ok. + +m2([#r{id = a}]) -> % violation + ok. + +m3({#r{id = a}}) -> % can never match; not so good + ok. + +m4(#{a := #r{id = a}}) -> % violation not found + ok. |