diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-02-15 12:56:45 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-02-15 12:56:45 -0800 |
commit | f592d8629f3fddaebff4abece8f92e57e9379418 (patch) | |
tree | 7d3927dc082093e4a87e66ae932f99e7ec85e31a /033exclusive_container.cc | |
parent | cf36334305b82dc36f7a2423382ccd8b21bb4eae (diff) | |
download | mu-f592d8629f3fddaebff4abece8f92e57e9379418.tar.gz |
2660 - check dynamic arrays in exclusive containers
Also a bugfix: don't cause future parse errors when these checks are triggered.
Diffstat (limited to '033exclusive_container.cc')
-rw-r--r-- | 033exclusive_container.cc | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/033exclusive_container.cc b/033exclusive_container.cc index 1d63f593..3b1dc201 100644 --- a/033exclusive_container.cc +++ b/033exclusive_container.cc @@ -179,6 +179,23 @@ else if (command == "exclusive-container") { insert_container(command, EXCLUSIVE_CONTAINER, in); } +//: arrays are disallowed inside exclusive containers unless their length is +//: fixed in advance + +:(scenario exclusive_container_contains_array) +% Hide_errors = true; +exclusive-container foo [ + x:array:number:3 +] +$error: 0 + +:(scenario exclusive_container_warns_on_dynamic_array_element) +% Hide_errors = true; +exclusive-container foo [ + x:array:number +] ++error: container 'foo' cannot determine size of element x + //:: To construct exclusive containers out of variant types, use 'merge'. :(scenario lift_to_exclusive_container) exclusive-container foo [ |