aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_types.hrl
diff options
context:
space:
mode:
authorJohn Högberg <[email protected]>2019-05-29 16:11:46 +0200
committerJohn Högberg <[email protected]>2019-06-12 15:03:46 +0200
commit48f83e165a2dae8ed04a74ba3c6308250168f790 (patch)
tree95c292f7c74aedad0c0bd75b64eec38698dd7dba /lib/compiler/src/beam_types.hrl
parent4411b1953bfb862aad433c2269acb82a35b0cc72 (diff)
downloadotp-48f83e165a2dae8ed04a74ba3c6308250168f790.tar.gz
otp-48f83e165a2dae8ed04a74ba3c6308250168f790.tar.bz2
otp-48f83e165a2dae8ed04a74ba3c6308250168f790.zip
beam_validator: Replace old type representation with beam_types
Diffstat (limited to 'lib/compiler/src/beam_types.hrl')
-rw-r--r--lib/compiler/src/beam_types.hrl7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_types.hrl b/lib/compiler/src/beam_types.hrl
index b82cdf8df2..825eca4c64 100644
--- a/lib/compiler/src/beam_types.hrl
+++ b/lib/compiler/src/beam_types.hrl
@@ -37,6 +37,8 @@
%% -- cons Cons (nonempty list).
%% -- nil The empty list.
%% - #t_tuple{} Tuple.
+%% - #t_abstract{} Psuedo-type used in the validator to track tuples
+% under construction, match context positions, etc.
%%
%% none No type (bottom element).
@@ -52,6 +54,7 @@
-record(t_tuple, {size=0 :: integer(),
exact=false :: boolean(),
elements=#{} :: tuple_elements()}).
+-record(t_abstract, {kind :: atom()}).
%% Known element types, unknown elements are assumed to be 'any'. The key is
%% a 1-based integer index for tuples, and a plain literal for maps (that is,
@@ -65,5 +68,5 @@
-type type() :: any | none |
list | number |
#t_atom{} | #t_bitstring{} | #t_bs_context{} | #t_fun{} |
- #t_integer{} | #t_map{} | #t_tuple{} | 'cons' |
- 'float' | 'nil'.
+ #t_integer{} | #t_map{} | #t_tuple{} | #t_abstract{} |
+ 'cons' | 'float' | 'nil'.