about summary refs log tree commit diff stats
path: root/cpp/025name
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-03-20 21:33:32 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-03-20 21:33:32 -0700
commit72cc3ae158eb444893f0837e3fc3bc99ca6d83f0 (patch)
treea28a9ff043b06ae814eb9c425837e3c11bec0891 /cpp/025name
parent198ad74126b72aa5e1e242468db1586234df91ba (diff)
downloadmu-72cc3ae158eb444893f0837e3fc3bc99ca6d83f0.tar.gz
963
Amazing how easy that was.
Diffstat (limited to 'cpp/025name')
-rw-r--r--cpp/025name12
1 files changed, 11 insertions, 1 deletions
diff --git a/cpp/025name b/cpp/025name
index e3d290c3..7654907a 100644
--- a/cpp/025name
+++ b/cpp/025name
@@ -68,7 +68,7 @@ void transform_names(const recipe_number r) {
         if (names.find(inst.products[out].name) == names.end()) {
           trace("name") << "assign " << inst.products[out].name << " " << curr_idx;
           names[inst.products[out].name] = curr_idx;
-          ++curr_idx;
+          curr_idx += size_of(inst.products[out]);
         }
         inst.products[out].value = names[inst.products[out].name];
         inst.products[out].initialized = true;
@@ -136,3 +136,13 @@ recipe main [
 ]
 +name: field y of type point is at offset 1
 +name: field x of type point is at offset 0
+
+//: this test is actually illegal so can't call run
+:(scenarios transform_test)
+:(scenario "convert_names_handles_records")
+recipe main [
+  a:point <- copy 0:literal
+  b:integer <- copy 0:literal
+]
++name: assign a 1
++name: assign b 3