diff --git a/examples/recursion/src/recursion/index.did b/examples/recursion/src/recursion/index.did index 1b3b308f39..cb764937a7 100644 --- a/examples/recursion/src/recursion/index.did +++ b/examples/recursion/src/recursion/index.did @@ -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; @@ -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}; @@ -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; -} \ No newline at end of file + 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; +} diff --git a/src/lib_new/visitors/did_visitor.ts b/src/lib_new/visitors/did_visitor.ts index 2d7f2c291a..11ee62a97a 100644 --- a/src/lib_new/visitors/did_visitor.ts +++ b/src/lib_new/visitors/did_visitor.ts @@ -250,6 +250,7 @@ export class DidVisitor extends IDL.Visitor { const usedRecClasses = data.usedRecClasses; if (!usedRecClasses.includes(t)) { const candid = hch(ty).accept(this, { + ...data, usedRecClasses: [...usedRecClasses, t], isOnService: false, isFirstService: false