aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2013-06-27 14:49:12 +0200
committerBjörn Gustavsson <[email protected]>2013-08-30 10:13:16 +0200
commit9033435e5b8051608c7e867051c1a8e6b946d2a9 (patch)
tree788ee5070999eb5d67b4c370175b71be2bc74d05 /lib/asn1/src/asn1ct_gen.erl
parentbf13576de7f8a3cd56a268e3bf9cdf6535ea2334 (diff)
downloadotp-9033435e5b8051608c7e867051c1a8e6b946d2a9.tar.gz
otp-9033435e5b8051608c7e867051c1a8e6b946d2a9.tar.bz2
otp-9033435e5b8051608c7e867051c1a8e6b946d2a9.zip
Remove broken support for multiple UNIQUE
According to the ASN.1 standard, having multiple UNIQUE in class is allowed. For example: C ::= CLASS { &id1 INTEGER UNIQUE, &id2 INTEGER UNIQUE } In practice, no one uses multiple UNIQUE. The ASN.1 compiler will crash if a class with multiple UNIQUE is used, but the backends have half-hearted support for multiple UNIQUE in that they generate helper functions similar to: getenc_OBJECT_SET(id1, 42) -> fun enc_XXX/3; ... Since we have no plans to implement support for multiple UNIQUE (no one seems to have missed it), simplify the helper functions like this: getenc_OBJECT_SET(42) -> fun enc_XXX/3; ...
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 9095e145a3..acbd1026ff 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -834,9 +834,9 @@ pgen_exports(Erules,_Module,{Types,Values,_,_,Objects,ObjectSets}) ->
[] -> ok;
_ ->
emit({"-export([",nl}),
- gen_exports1(ObjectSets,"getenc_",2),
+ gen_exports1(ObjectSets, "getenc_",1),
emit({"-export([",nl}),
- gen_exports1(ObjectSets,"getdec_",2)
+ gen_exports1(ObjectSets, "getdec_",1)
end,
emit({"-export([info/0]).",nl}),
gen_partial_inc_decode_exports(),