diff options
author | Hans Bolinder <[email protected]> | 2015-01-09 09:30:44 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2015-03-10 10:48:29 +0100 |
commit | 747955f26376486eb7ecbd8f9a6144ba668a21c7 (patch) | |
tree | 987d667092ccac3ed982858365b71e3d3266c35b /lib/dialyzer/test/small_SUITE_data/src/ditrap.erl | |
parent | 0d4d8c85bf167f3ffe5f8f7b83962724e4f4b59f (diff) | |
download | otp-747955f26376486eb7ecbd8f9a6144ba668a21c7.tar.gz otp-747955f26376486eb7ecbd8f9a6144ba668a21c7.tar.bz2 otp-747955f26376486eb7ecbd8f9a6144ba668a21c7.zip |
[dialyzer] Add testcases
The tests cannot be handled by earlier versions of Dialyzer.
Diffstat (limited to 'lib/dialyzer/test/small_SUITE_data/src/ditrap.erl')
-rw-r--r-- | lib/dialyzer/test/small_SUITE_data/src/ditrap.erl | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/dialyzer/test/small_SUITE_data/src/ditrap.erl b/lib/dialyzer/test/small_SUITE_data/src/ditrap.erl new file mode 100644 index 0000000000..2d75f25bd5 --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/ditrap.erl @@ -0,0 +1,47 @@ +%% A bug reported by Tail-f Systems. The problem is that record types +%% are included without properly limiting their depth. + +-module(ditrap). + +-define(tref(T), ?MODULE:T). +-define(fref(T), ?MODULE:T). + +-export_type([ module_rec/0 + , typedef_rec/0 + , type_spec_fun/0 + ]). + +-record(type, { + base :: 'builtin' | external:random_type() | ?tref(typedef_rec()), + type_spec_fun :: ?fref(type_spec_fun()) + }). + +-record(typedef, {type :: #type{}}). + +-record(typedefs, { + map :: ?tref(typedef_rec()), + parent :: 'undefined' | #typedefs{} + }). + +-record(sn, { + module :: ?tref(module_rec()), + typedefs :: #typedefs{}, + type :: 'undefined' | #type{}, + keys :: 'undefined' | [#sn{}], + children = [] :: [#sn{}] + }). + +-record(augment, {children = [] :: [#sn{}]}). + +-record(module, { + submodules = [] :: [{#module{}, external:pos()}], + typedefs = #typedefs{} :: #typedefs{}, + children = [] :: [#sn{}], + remote_augments = [] :: [{ModuleName :: atom(), [#augment{}]}], + local_augments = [] :: [#augment{}] + }). + +-type typedef_rec() :: #typedef{}. +-type module_rec() :: #module{}. + +-type type_spec_fun() :: undefined | fun((#type{}, #module{}) -> any()). |