diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-10-31 17:18:59 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-10-31 17:24:39 -0700 |
commit | 3fdb963b142774e432c35eea5cb45e40f8152cdb (patch) | |
tree | 363efc7af889e72813081a7d3565bc3de72a8515 | |
parent | 23692627f932937e37ad49e0354d7691b66577be (diff) | |
download | mu-3fdb963b142774e432c35eea5cb45e40f8152cdb.tar.gz |
2332
-rw-r--r-- | 059generic_recipe.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/059generic_recipe.cc b/059generic_recipe.cc index 38eab3d1..e6bd16ae 100644 --- a/059generic_recipe.cc +++ b/059generic_recipe.cc @@ -11,7 +11,7 @@ recipe foo a:number -> result:number [ load-ingredients result <- copy 34 ] -# generically matching variant +# matching generic variant recipe foo a:_t -> result:_t [ local-scope load-ingredients @@ -141,3 +141,23 @@ recipe_ordinal new_variant(recipe_ordinal exemplar, const instruction& inst) { bool is_type_ingredient(const reagent& x) { return x.properties.at(0).second->value.at(0) == '_'; } + +:(scenario generic_recipe_2) +recipe main [ + 10:point <- merge 14, 15 + 11:point <- foo 10:point +] +# non-matching generic variant +recipe foo a:_t, b:_t -> result:number [ + local-scope + load-ingredients + result <- copy 34 +] +# matching generic variant +recipe foo a:_t -> result:_t [ + local-scope + load-ingredients + result <- copy a +] ++mem: storing 14 in location 11 ++mem: storing 15 in location 12 |