address 0x42 { module M { struct S has copy, drop, store, key {} struct R has key, store {} struct Box has copy, drop, store, key { f: T } struct Pair has copy, drop, store, key { f1: T1, f2: T2 } fun c() {} fun d() {} fun s() {} fun k() {} fun sk() {} fun cds() {} struct Sc {} struct Sd {} struct Ss {} struct Sk {} struct Ssk {} struct Scds {} // tests that a variety of constraint instantiations are all valid fun t1< Tc: copy, Td: drop, Ts: store, Tk: key, Tcd: copy + drop, Tcs: copy + store, Tds: drop + store, Tsk: store + key, Tcds: copy + drop + store >() { // functions with prims c(); d(); s(); cds
(); c>(); d>(); s>(); cds>(); // structs with prims let Sc {} = Sc {}; let Sd {} = Sd {}; let Ss {} = Ss {}; let Scds {} = Scds
{}; let Sc {} = Sc> {}; let Sd {} = Sd> {}; let Ss {} = Ss> {}; let Scds {} = Scds> {}; // functions with tparams c(); c(); c(); c(); d(); d(); d(); d(); s(); s(); s(); s(); s(); k(); k(); sk(); cds(); // structs with tparams let Sc {} = Sc {}; let Sc {} = Sc {}; let Sc {} = Sc {}; let Sc {} = Sc {}; let Sd {} = Sd {}; let Sd {} = Sd {}; let Sd {} = Sd {}; let Sd {} = Sd {}; let Ss {} = Ss {}; let Ss {} = Ss {}; let Ss {} = Ss {}; let Ss {} = Ss {}; let Ss {} = Ss {}; let Sk {} = Sk {}; let Sk {} = Sk {}; let Ssk {} = Ssk {}; let Scds {} = Scds {}; // functions with structs c(); c>(); c, S>>(); d(); d>(); d, S>>(); s(); s(); s>(); s>(); s, S>>(); s>>>(); k(); k>(); k>>(); k>>>(); sk(); sk>(); sk>>(); sk>>>(); cds(); cds>(); cds, S>>(); // structs with structs let Sc {} = Sc {}; let Sc {} = Sc> {}; let Sc {} = Sc, S>> {}; let Sd {} = Sd {}; let Sd {} = Sd> {}; let Sd {} = Sd, S>> {}; let Ss {} = Ss {}; let Ss {} = Ss {}; let Ss {} = Ss> {}; let Ss {} = Ss> {}; let Ss {} = Ss, S>> {}; let Ss {} = Ss>>> {}; let Sk {} = Sk {}; let Sk {} = Sk> {}; let Sk {} = Sk>> {}; let Sk {} = Sk>>> {}; let Ssk {} = Ssk {}; let Ssk {} = Ssk> {}; let Ssk {} = Ssk>> {}; let Ssk {} = Ssk>>> {}; let Scds {} = Scds {}; let Scds {} = Scds> {}; let Scds {} = Scds, S>> {}; } } }