//# publish module 0x1.Cup { struct Cup { f: T } public cup(f: T): Self.Cup { label b0: return Cup { f: move(f) }; } } //# publish module 0x1.M0 { // recursive struct struct Foo { f: Self.Foo } } //# publish module 0x1.M1 { import 0x1.Cup; // recursive struct struct Foo { f: Cup.Cup } // would blow up the stack public foo(): Self.Foo { label b0: return Foo { f: Cup.cup(Self.foo()) }; } } //# publish module 0x1.M2 { import 0x1.signer; struct X { y: vector } struct Y { x: vector } // would blow up the vm public ex(account: &signer): bool { label b0: return exists(signer.address_of(move(account))); } // would blow up the vm public borrow(account: &signer) acquires X { label b0: _ = borrow_global(signer.address_of(move(account))); return; } } //# publish module 0x1.M3 { import 0x1.Cup; // recursive struct struct Foo { f: Cup.Cup } } //# publish module 0x1.M3 { import 0x1.Cup; // indirect recursive struct struct A { b: Self.B } struct B { c: Self.C } struct C { d: vector } struct D { x: Cup.Cup>> } }