diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-04-15 22:34:08 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-04-15 22:34:08 -0700 |
commit | bd3620ebf7efd823889d35e06f56a544dee0ce70 (patch) | |
tree | 0647edb1f2e243b8a9d2c0f7ce0b49cb0e0797d6 | |
parent | d785efe59c4b586763728b2a5574cf5fd8574f17 (diff) | |
download | mu-bd3620ebf7efd823889d35e06f56a544dee0ce70.tar.gz |
2837 - fix up 2836
On reflection I think I'd rather add a duplicate test that's closer to how I discovered the problem, without the masking bug in type-matching that was masking the simpler test in the previous commit.
-rw-r--r-- | 058shape_shifting_recipe.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/058shape_shifting_recipe.cc b/058shape_shifting_recipe.cc index 0c48d596..a4370ac9 100644 --- a/058shape_shifting_recipe.cc +++ b/058shape_shifting_recipe.cc @@ -992,7 +992,7 @@ def foo x:address:shared:_elem -> y:number [ :(scenario missing_type_during_specialization) % Hide_errors = true; # define a shape-shifting recipe -def foo4 a:_elem [ +def foo a:_elem [ ] # define a container with field 'z' container foo2 [ @@ -1005,6 +1005,26 @@ def main [ # define a variable with the same name 'z' z:number <- copy 34 # trigger specialization of the shape-shifting recipe - foo4 z + foo z +] +# shouldn't crash + +:(scenario missing_type_during_specialization2) +% Hide_errors = true; +# define a shape-shifting recipe +def foo a:_elem [ +] +# define a container with field 'z' +container foo2 [ + z:number +] +def main [ + local-scope + x:foo2 <- merge 34 + y:number <- get x, z:offse # typo in 'offset' + # define a variable with the same name 'z' + z:address:number <- copy 34 + # trigger specialization of the shape-shifting recipe + foo *z ] # shouldn't crash |