Skip to content

Commit

Permalink
update rec visitor to pass the rest of the data
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Sep 30, 2023
1 parent 2758f2f commit c00e211
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 42 deletions.
70 changes: 28 additions & 42 deletions examples/recursion/src/recursion/index.did
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
type rec_397 = service {myQuery: (rec_397) -> (rec_397) query;};
type rec_400 = service {myQuery: (rec_400) -> (rec_400) query;};
type rec_365 = func (rec_365) -> (rec_365) query;
type rec_368 = func (rec_368) -> (rec_368) query;
type rec_373 = func (rec_373) -> (rec_373) query;
Expand All @@ -10,27 +12,11 @@ type rec_337 = record {myVar:variant {num:int8; varRec:rec_337}};
type rec_289 = record {myVecRecords:vec rec_289};
type rec_292 = record {myVecRecords:vec rec_292};
type rec_333 = record {myVecRecords:vec rec_333};
type rec_385 = service {
myQuery: (rec_385) -> (rec_385) query;
};
type rec_388 = service {
myQuery: (rec_388) -> (rec_388) query;
};
type rec_397 = service {
myQuery: (rec_397) -> (rec_397) query;
};
type rec_400 = service {
myQuery: (rec_400) -> (rec_400) query;
};
type rec_393 = service {
myQuery: (rec_393) -> (rec_393) query;
};
type rec_377 = service {
myQuery: (rec_377) -> (rec_377) query;
};
type rec_380 = service {
myQuery: (rec_380) -> (rec_380) query;
};
type rec_385 = service {myQuery: (rec_385) -> (rec_385) query;};
type rec_388 = service {myQuery: (rec_388) -> (rec_388) query;};
type rec_393 = service {myQuery: (rec_393) -> (rec_393) query;};
type rec_377 = service {myQuery: (rec_377) -> (rec_377) query;};
type rec_380 = service {myQuery: (rec_380) -> (rec_380) query;};
type rec_313 = record {opt rec_313; opt rec_313};
type rec_316 = record {opt rec_316; opt rec_316};
type rec_345 = record {opt rec_345; opt rec_345};
Expand All @@ -44,24 +30,24 @@ type rec_305 = variant {num:int8; recVariant:rec_305};
type rec_308 = variant {num:int8; recVariant:rec_308};
type rec_341 = variant {num:int8; recVariant:rec_341};
service: () -> {
testRecFunc: (rec_365) -> (rec_368) query;
testRecFuncReturn: () -> (rec_373) query;
testRecRecordWithOpt: (rec_281) -> (rec_284) query;
testRecRecordWithOptReturn: () -> (rec_329) query;
testRecRecordWithVariant: (rec_297) -> (rec_300) query;
testRecRecordWithVariantReturn: () -> (rec_337) query;
testRecRecordWithVec: (rec_289) -> (rec_292) query;
testRecRecordWithVecReturn: () -> (rec_333) query;
testRecService: (rec_385) -> (rec_388) query;
testRecServiceCall: (rec_397) -> (rec_400) ;
testRecServiceReturn: () -> (rec_393) query;
testRecServiceSimple: (rec_377) -> (rec_380) query;
testRecTupleWithOpt: (rec_313) -> (rec_316) query;
testRecTupleWithOptReturn: () -> (rec_345) query;
testRecTupleWithVariant: (rec_353) -> (rec_356) query;
testRecTupleWithVariantReturn: () -> (rec_361) query;
testRecTupleWithVec: (rec_321) -> (rec_324) query;
testRecTupleWithVecReturn: () -> (rec_349) query;
testRecVariant: (rec_305) -> (rec_308) query;
testRecVariantReturn: () -> (rec_341) query;
}
testRecFunc: (rec_365) -> (rec_368) query;
testRecFuncReturn: () -> (rec_373) query;
testRecRecordWithOpt: (rec_281) -> (rec_284) query;
testRecRecordWithOptReturn: () -> (rec_329) query;
testRecRecordWithVariant: (rec_297) -> (rec_300) query;
testRecRecordWithVariantReturn: () -> (rec_337) query;
testRecRecordWithVec: (rec_289) -> (rec_292) query;
testRecRecordWithVecReturn: () -> (rec_333) query;
testRecService: (rec_385) -> (rec_388) query;
testRecServiceCall: (rec_397) -> (rec_400) ;
testRecServiceReturn: () -> (rec_393) query;
testRecServiceSimple: (rec_377) -> (rec_380) query;
testRecTupleWithOpt: (rec_313) -> (rec_316) query;
testRecTupleWithOptReturn: () -> (rec_345) query;
testRecTupleWithVariant: (rec_353) -> (rec_356) query;
testRecTupleWithVariantReturn: () -> (rec_361) query;
testRecTupleWithVec: (rec_321) -> (rec_324) query;
testRecTupleWithVecReturn: () -> (rec_349) query;
testRecVariant: (rec_305) -> (rec_308) query;
testRecVariantReturn: () -> (rec_341) query;
}
1 change: 1 addition & 0 deletions src/lib_new/visitors/did_visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ export class DidVisitor extends IDL.Visitor<VisitorData, VisitorResult> {
const usedRecClasses = data.usedRecClasses;
if (!usedRecClasses.includes(t)) {
const candid = hch(ty).accept(this, {
...data,
usedRecClasses: [...usedRecClasses, t],
isOnService: false,
isFirstService: false
Expand Down

0 comments on commit c00e211

Please sign in to comment.