From 0c5f8821225dad9b7428919045f5db9702d40302 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Mon, 28 Oct 2024 16:03:20 +0300 Subject: [PATCH 01/16] add new feature to meta.Function --- internal/tlcodegen/qt_meta.qtpl | 2 ++ internal/tlcodegen/qt_meta.qtpl.go | 2 ++ internal/tlcodegen/qt_struct.qtpl | 5 +++++ internal/tlcodegen/qt_struct.qtpl.go | 11 ++++++++++- internal/tlcodegen/type_rw.go | 1 + internal/tlcodegen/type_rw_bool.go | 4 ++++ internal/tlcodegen/type_rw_maybe.go | 4 ++++ internal/tlcodegen/type_rw_primitive.go | 4 ++++ internal/tlcodegen/type_rw_struct.go | 9 +++++++++ internal/tlcodegen/type_rw_tuple.go | 4 ++++ internal/tlcodegen/type_rw_union.go | 4 ++++ 11 files changed, 49 insertions(+), 1 deletion(-) diff --git a/internal/tlcodegen/qt_meta.qtpl b/internal/tlcodegen/qt_meta.qtpl index c5e5fdcb..74c312a2 100644 --- a/internal/tlcodegen/qt_meta.qtpl +++ b/internal/tlcodegen/qt_meta.qtpl @@ -44,6 +44,8 @@ type Object interface { type Function interface { Object + ContainsUnionTypesInResult() bool + ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error diff --git a/internal/tlcodegen/qt_meta.qtpl.go b/internal/tlcodegen/qt_meta.qtpl.go index 65bce294..ad104782 100644 --- a/internal/tlcodegen/qt_meta.qtpl.go +++ b/internal/tlcodegen/qt_meta.qtpl.go @@ -81,6 +81,8 @@ type Object interface { type Function interface { Object + ContainsUnionTypesInResult() bool + ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error diff --git a/internal/tlcodegen/qt_struct.qtpl b/internal/tlcodegen/qt_struct.qtpl index b71f76e5..939aae7a 100644 --- a/internal/tlcodegen/qt_struct.qtpl +++ b/internal/tlcodegen/qt_struct.qtpl @@ -744,6 +744,11 @@ vru.replicaState#3d74578e fields_mask:# pre_vote_demote :fields_mask.10?string goName := addBytes(struct_.wr.goGlobalName, bytesVersion) retArg := struct_.ResultType.TypeString2(bytesVersion, directImports, struct_.wr.ins, false, false) -%} + +func (item *{%s= goName %}) ContainsUnionTypesInResult() bool { + return {%v= struct_.ResultType.trw.ContainsUnion() %} +} + func (item *{%s= goName %}) ReadResult(w []byte, ret *{%s= retArg %}) (_ []byte, err error) { {%s= struct_.ResultType.TypeReadingCode(bytesVersion, directImports, struct_.wr.ins, "ret", false, formatNatArgs(struct_.Fields, struct_.ResultNatArgs), true, true) %} } diff --git a/internal/tlcodegen/qt_struct.qtpl.go b/internal/tlcodegen/qt_struct.qtpl.go index 9bf7c849..2385da25 100644 --- a/internal/tlcodegen/qt_struct.qtpl.go +++ b/internal/tlcodegen/qt_struct.qtpl.go @@ -1575,7 +1575,16 @@ func (struct_ *TypeRWStruct) streamfunctionCode(qw422016 *qt422016.Writer, bytes goName := addBytes(struct_.wr.goGlobalName, bytesVersion) retArg := struct_.ResultType.TypeString2(bytesVersion, directImports, struct_.wr.ins, false, false) - qw422016.N().S(`func (item *`) + qw422016.N().S(` +func (item *`) + qw422016.N().S(goName) + qw422016.N().S(`) ContainsUnionTypesInResult() bool { + return `) + qw422016.N().V(struct_.ResultType.trw.ContainsUnion()) + qw422016.N().S(` +} + +func (item *`) qw422016.N().S(goName) qw422016.N().S(`) ReadResult(w []byte, ret *`) qw422016.N().S(retArg) diff --git a/internal/tlcodegen/type_rw.go b/internal/tlcodegen/type_rw.go index 753c86cc..f59b3b08 100644 --- a/internal/tlcodegen/type_rw.go +++ b/internal/tlcodegen/type_rw.go @@ -709,6 +709,7 @@ type TypeRW interface { AllPossibleRecursionProducers() []*TypeRWWrapper AllTypeDependencies(generic, countFunctions bool) []*TypeRWWrapper IsWrappingType() bool + ContainsUnion() bool BeforeCodeGenerationStep1() // during first phase, some wr.trw are nil due to recursive types. So we delay some BeforeCodeGenerationStep2() // during second phase, union fields recursive bit is set diff --git a/internal/tlcodegen/type_rw_bool.go b/internal/tlcodegen/type_rw_bool.go index cf6b578d..fd0c33b7 100644 --- a/internal/tlcodegen/type_rw_bool.go +++ b/internal/tlcodegen/type_rw_bool.go @@ -54,6 +54,10 @@ func (trw *TypeRWBool) IsWrappingType() bool { return true } +func (trw *TypeRWBool) ContainsUnion() bool { + return false +} + func (trw *TypeRWBool) FillRecursiveChildren(visitedNodes map[*TypeRWWrapper]int, generic bool) { } diff --git a/internal/tlcodegen/type_rw_maybe.go b/internal/tlcodegen/type_rw_maybe.go index 0df7ff30..2d84cdce 100644 --- a/internal/tlcodegen/type_rw_maybe.go +++ b/internal/tlcodegen/type_rw_maybe.go @@ -55,6 +55,10 @@ func (trw *TypeRWMaybe) IsWrappingType() bool { return true } +func (trw *TypeRWMaybe) ContainsUnion() bool { + return true +} + func (trw *TypeRWMaybe) FillRecursiveChildren(visitedNodes map[*TypeRWWrapper]int, generic bool) { visitedNodes[trw.wr] = 1 trw.element.t.trw.FillRecursiveChildren(visitedNodes, generic) diff --git a/internal/tlcodegen/type_rw_primitive.go b/internal/tlcodegen/type_rw_primitive.go index 2f3ee4d2..3dec0bab 100644 --- a/internal/tlcodegen/type_rw_primitive.go +++ b/internal/tlcodegen/type_rw_primitive.go @@ -70,6 +70,10 @@ func (trw *TypeRWPrimitive) IsWrappingType() bool { return true } +func (trw *TypeRWPrimitive) ContainsUnion() bool { + return false +} + func (trw *TypeRWPrimitive) FillRecursiveChildren(visitedNodes map[*TypeRWWrapper]int, generic bool) { } diff --git a/internal/tlcodegen/type_rw_struct.go b/internal/tlcodegen/type_rw_struct.go index 3b611002..be5f6a36 100644 --- a/internal/tlcodegen/type_rw_struct.go +++ b/internal/tlcodegen/type_rw_struct.go @@ -185,6 +185,15 @@ func (trw *TypeRWStruct) IsWrappingType() bool { return trw.isUnwrapType() } +func (trw *TypeRWStruct) ContainsUnion() bool { + for _, f := range trw.Fields { + if f.t.trw.ContainsUnion() { + return true + } + } + return false +} + func (trw *TypeRWStruct) FillRecursiveChildren(visitedNodes map[*TypeRWWrapper]int, generic bool) { if visitedNodes[trw.wr] != 0 { return diff --git a/internal/tlcodegen/type_rw_tuple.go b/internal/tlcodegen/type_rw_tuple.go index 8243c24d..0139720a 100644 --- a/internal/tlcodegen/type_rw_tuple.go +++ b/internal/tlcodegen/type_rw_tuple.go @@ -108,6 +108,10 @@ func (trw *TypeRWBrackets) IsWrappingType() bool { return false } +func (trw *TypeRWBrackets) ContainsUnion() bool { + return false +} + func (trw *TypeRWBrackets) BeforeCodeGenerationStep1() { if trw.vectorLike { if ok, isString, kf, vf := isDictionaryElement(trw.element.t); ok { diff --git a/internal/tlcodegen/type_rw_union.go b/internal/tlcodegen/type_rw_union.go index 43268787..30a8ac36 100644 --- a/internal/tlcodegen/type_rw_union.go +++ b/internal/tlcodegen/type_rw_union.go @@ -87,6 +87,10 @@ func (trw *TypeRWUnion) IsWrappingType() bool { return false } +func (trw *TypeRWUnion) ContainsUnion() bool { + return true +} + func (trw *TypeRWUnion) BeforeCodeGenerationStep1() { } From ed90cff99bebae4cf874b5d0a33eda61c98b7585 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Mon, 28 Oct 2024 16:03:33 +0300 Subject: [PATCH 02/16] updated goldmaster --- internal/tlcodegen/test/gen/cases/meta/meta.go | 2 ++ .../test/gen/goldmaster/internal/tl/tlCall1/call1.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall2/call2.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall3/call3.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall4/call4.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall5/call5.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall6/call6.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall7/call7.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall8/call8.go | 4 ++++ .../test/gen/goldmaster/internal/tl/tlCall9/call9.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go | 4 ++++ .../test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go | 4 ++++ .../internal/tlservice5/tlService5Insert/service5.insert.go | 4 ++++ .../tlService5LongInsert/service5Long.insert.go | 4 ++++ .../usefulService.getUserEntity.go | 4 ++++ internal/tlcodegen/test/gen/goldmaster/meta/meta.go | 2 ++ .../test/gen/goldmaster_nosplit/internal/ab.call1.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call2.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call3.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call4.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call5.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call6.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call7.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call8.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/ab.call9.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go | 4 ++++ .../tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go | 4 ++++ .../test/gen/goldmaster_nosplit/internal/service5.insert.go | 4 ++++ .../gen/goldmaster_nosplit/internal/service5Long.insert.go | 4 ++++ .../internal/usefulService.getUserEntity.go | 4 ++++ internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go | 2 ++ 45 files changed, 174 insertions(+) diff --git a/internal/tlcodegen/test/gen/cases/meta/meta.go b/internal/tlcodegen/test/gen/cases/meta/meta.go index 8276c719..1cb7936c 100644 --- a/internal/tlcodegen/test/gen/cases/meta/meta.go +++ b/internal/tlcodegen/test/gen/cases/meta/meta.go @@ -41,6 +41,8 @@ type Object interface { type Function interface { Object + ContainsUnionTypesInResult() bool + ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go index b3ec9c8b..4551b75e 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go @@ -63,6 +63,10 @@ func (item *Call1) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call1) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call1) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go index bb687693..6d6c0669 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go @@ -63,6 +63,10 @@ func (item *Call2) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call2) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call2) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go index c5521b71..b36e3660 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go @@ -63,6 +63,10 @@ func (item *Call3) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call3) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call3) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go index 7d8bb079..0baf7c13 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go @@ -63,6 +63,10 @@ func (item *Call4) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call4) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call4) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go index c2fbca9a..cdadad8c 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go @@ -63,6 +63,10 @@ func (item *Call5) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call5) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call5) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go index f8ba82fe..22cf821d 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go @@ -63,6 +63,10 @@ func (item *Call6) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call6) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call6) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go index f2f0653a..059a825a 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go @@ -63,6 +63,10 @@ func (item *Call7) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call7) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call7) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go index 5bc5fad2..e8d9da38 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go @@ -63,6 +63,10 @@ func (item *Call8) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call8) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call8) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go index e8aa7fae..2fe9696a 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go @@ -63,6 +63,10 @@ func (item *Call9) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call9) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call9) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go index c7ada15a..2f9b2f1e 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go @@ -63,6 +63,10 @@ func (item *AbCall1) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall1) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall1) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go index ac4a65c6..72328666 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go @@ -63,6 +63,10 @@ func (item *AbCall2) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall2) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall2) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go index e6d31d3e..ace4e027 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go @@ -63,6 +63,10 @@ func (item *AbCall3) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall3) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall3) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go index 8ac8aa48..3eca1318 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go @@ -63,6 +63,10 @@ func (item *AbCall4) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall4) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall4) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go index c30fc33d..41906de6 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go @@ -63,6 +63,10 @@ func (item *AbCall5) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall5) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall5) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go index 3cd8333c..2c80c437 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go @@ -63,6 +63,10 @@ func (item *AbCall6) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall6) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall6) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go index 6ba5d2b9..0443623e 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go @@ -63,6 +63,10 @@ func (item *AbCall7) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall7) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall7) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go index 273a91a4..a202b0ef 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go @@ -63,6 +63,10 @@ func (item *AbCall8) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall8) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall8) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go index 3de9cf0a..ad669503 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go @@ -63,6 +63,10 @@ func (item *AbCall9) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall9) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall9) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go index a0edbdea..1b4381ab 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go @@ -80,6 +80,10 @@ func (item *Service5Insert) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Service5Insert) ContainsUnionTypesInResult() bool { + return true +} + func (item *Service5Insert) ReadResult(w []byte, ret *cycle_16847572a0831d4cd4c0c0fb513151f3.Service5Output) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go index d8a42aef..0389dbf8 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go @@ -80,6 +80,10 @@ func (item *Service5LongInsert) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Service5LongInsert) ContainsUnionTypesInResult() bool { + return true +} + func (item *Service5LongInsert) ReadResult(w []byte, ret *cycle_98d4570147919cfd6f6ebfc47c3e10a0.Service5LongOutput) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go index a149b206..c330c584 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go @@ -97,6 +97,10 @@ func (item *UsefulServiceGetUserEntity) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *UsefulServiceGetUserEntity) ContainsUnionTypesInResult() bool { + return true +} + func (item *UsefulServiceGetUserEntity) ReadResult(w []byte, ret *tlUsefulServiceGetUserEntityResultBoxedMaybe.UsefulServiceGetUserEntityResultBoxedMaybe) (_ []byte, err error) { return ret.ReadBoxed(w, item.FieldsMask) } diff --git a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go index ff04033d..37a437bf 100644 --- a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go @@ -43,6 +43,8 @@ type Object interface { type Function interface { Object + ContainsUnionTypesInResult() bool + ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go index 59a5325f..304a10ae 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go @@ -59,6 +59,10 @@ func (item *AbCall1) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall1) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall1) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go index 3a948fbd..6311ddd9 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go @@ -59,6 +59,10 @@ func (item *AbCall2) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall2) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall2) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go index 7d1e02a0..a8aab157 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go @@ -59,6 +59,10 @@ func (item *AbCall3) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall3) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall3) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go index 8eb0582a..af5bae88 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go @@ -59,6 +59,10 @@ func (item *AbCall4) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall4) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall4) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go index a8be54d3..2547d276 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go @@ -59,6 +59,10 @@ func (item *AbCall5) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall5) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall5) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go index 9851206c..32e5c712 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go @@ -59,6 +59,10 @@ func (item *AbCall6) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall6) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall6) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go index 863b1b63..dd72345f 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go @@ -59,6 +59,10 @@ func (item *AbCall7) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall7) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall7) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go index ab3525e0..61a7e7e0 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go @@ -59,6 +59,10 @@ func (item *AbCall8) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall8) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall8) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go index 7fcaf0ed..02bb2e88 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go @@ -59,6 +59,10 @@ func (item *AbCall9) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *AbCall9) ContainsUnionTypesInResult() bool { + return false +} + func (item *AbCall9) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go index 18982fde..a8d32bec 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go @@ -59,6 +59,10 @@ func (item *Call1) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call1) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call1) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go index 0b0bbbac..245d63d2 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go @@ -59,6 +59,10 @@ func (item *Call2) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call2) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call2) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go index ab623e84..09a058f8 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go @@ -59,6 +59,10 @@ func (item *Call3) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call3) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call3) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go index 81b5fdd5..8da6f156 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go @@ -59,6 +59,10 @@ func (item *Call4) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call4) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call4) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go index 759bd1f3..94c46554 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go @@ -59,6 +59,10 @@ func (item *Call5) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call5) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call5) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go index 7447b6c4..0e7c0e34 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go @@ -59,6 +59,10 @@ func (item *Call6) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call6) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call6) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go index 4da80c44..bdbb0b34 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go @@ -59,6 +59,10 @@ func (item *Call7) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call7) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call7) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go index eadc7fd0..3e230ea5 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go @@ -59,6 +59,10 @@ func (item *Call8) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call8) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call8) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go index 06f107aa..91984d7b 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go @@ -59,6 +59,10 @@ func (item *Call9) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Call9) ContainsUnionTypesInResult() bool { + return false +} + func (item *Call9) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go index e042f5a3..785e5a95 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go @@ -77,6 +77,10 @@ func (item *Service5Insert) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Service5Insert) ContainsUnionTypesInResult() bool { + return true +} + func (item *Service5Insert) ReadResult(w []byte, ret *Service5Output) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go index 10b4af47..74a5aafb 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go @@ -77,6 +77,10 @@ func (item *Service5LongInsert) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *Service5LongInsert) ContainsUnionTypesInResult() bool { + return true +} + func (item *Service5LongInsert) ReadResult(w []byte, ret *Service5LongOutput) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go index 2161037c..f8f0fed8 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go @@ -94,6 +94,10 @@ func (item *UsefulServiceGetUserEntity) WriteBoxed(w []byte) []byte { return item.Write(w) } +func (item *UsefulServiceGetUserEntity) ContainsUnionTypesInResult() bool { + return true +} + func (item *UsefulServiceGetUserEntity) ReadResult(w []byte, ret *UsefulServiceGetUserEntityResultBoxedMaybe) (_ []byte, err error) { return ret.ReadBoxed(w, item.FieldsMask) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go index 0fede745..97fa63e9 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go @@ -43,6 +43,8 @@ type Object interface { type Function interface { Object + ContainsUnionTypesInResult() bool + ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error From d82719f8f7f4a5c84a5636a816822c96b3c70a2f Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Mon, 28 Oct 2024 16:12:29 +0300 Subject: [PATCH 03/16] update ContainsUnion for Maybe --- internal/tlcodegen/type_rw_maybe.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/tlcodegen/type_rw_maybe.go b/internal/tlcodegen/type_rw_maybe.go index 2d84cdce..60f23fdf 100644 --- a/internal/tlcodegen/type_rw_maybe.go +++ b/internal/tlcodegen/type_rw_maybe.go @@ -56,7 +56,7 @@ func (trw *TypeRWMaybe) IsWrappingType() bool { } func (trw *TypeRWMaybe) ContainsUnion() bool { - return true + return false } func (trw *TypeRWMaybe) FillRecursiveChildren(visitedNodes map[*TypeRWWrapper]int, generic bool) { From f24edcd99ff27f43f0e2fb7c0ccee19ce12a9848 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Mon, 28 Oct 2024 16:14:31 +0300 Subject: [PATCH 04/16] update goldmaster after prev fix --- .../tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go | 2 +- .../goldmaster_nosplit/internal/usefulService.getUserEntity.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go index c330c584..d1736b81 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go @@ -98,7 +98,7 @@ func (item *UsefulServiceGetUserEntity) WriteBoxed(w []byte) []byte { } func (item *UsefulServiceGetUserEntity) ContainsUnionTypesInResult() bool { - return true + return false } func (item *UsefulServiceGetUserEntity) ReadResult(w []byte, ret *tlUsefulServiceGetUserEntityResultBoxedMaybe.UsefulServiceGetUserEntityResultBoxedMaybe) (_ []byte, err error) { diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go index f8f0fed8..d2a5149f 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go @@ -95,7 +95,7 @@ func (item *UsefulServiceGetUserEntity) WriteBoxed(w []byte) []byte { } func (item *UsefulServiceGetUserEntity) ContainsUnionTypesInResult() bool { - return true + return false } func (item *UsefulServiceGetUserEntity) ReadResult(w []byte, ret *UsefulServiceGetUserEntityResultBoxedMaybe) (_ []byte, err error) { From a809f332e60255715faf13a1c0b59aa4fabc5cac Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Mon, 28 Oct 2024 16:45:27 +0300 Subject: [PATCH 05/16] moved From interFACE TO tlitem data --- internal/tlcodegen/qt_meta.qtpl | 11 ++++++++--- internal/tlcodegen/qt_meta.qtpl.go | 15 ++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/internal/tlcodegen/qt_meta.qtpl b/internal/tlcodegen/qt_meta.qtpl index 74c312a2..9b8a7302 100644 --- a/internal/tlcodegen/qt_meta.qtpl +++ b/internal/tlcodegen/qt_meta.qtpl @@ -44,8 +44,6 @@ type Object interface { type Function interface { Object - ContainsUnionTypesInResult() bool - ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error @@ -149,6 +147,9 @@ type TLItem struct { tag uint32 annotations uint32 tlName string + + resultTypeContainsUnionTypes bool + createFunction func() Function createFunctionLong func() Function createObject func() Object @@ -164,6 +165,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } +func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } + // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } func (item TLItem) CreateFunctionLong() Function { return item.createFunctionLong() } @@ -337,14 +340,16 @@ func init() { {%- if wr.tlTag == 0 || !wr.IsTopLevel() -%} {%- continue -%} {%- endif -%} {%- stripspace -%} {%- if fun, ok := wr.trw.(*TypeRWStruct); ok && len(wr.NatParams) == 0 -%} + {%- code resultTypeContainsUnionTypes := false -%} {%- if fun.ResultType != nil -%} + {%- code resultTypeContainsUnionTypes = fun.ResultType.trw.ContainsUnion() -%} fillFunction( {%- else -%} fillObject( {%- endif -%} "{%= wr.tlName.String() %}#{%s= fmt.Sprintf("%08x", wr.tlTag) %}", {%q= fmt.Sprintf("#%08x", wr.tlTag) %}, - &TLItem{tag: {%s= fmt.Sprintf("0x%08x", wr.tlTag) %}, annotations: {%s= fmt.Sprintf("0x%x", wr.AnnotationsMask()) %}, tlName: "{%= wr.tlName.String() %}"}) + &TLItem{tag: {%s= fmt.Sprintf("0x%08x", wr.tlTag) %}, annotations: {%s= fmt.Sprintf("0x%x", wr.AnnotationsMask()) %}, tlName: "{%= wr.tlName.String() %}", resultTypeContainsUnionTypes: {%v= resultTypeContainsUnionTypes %}}) {%- endif -%} {%- endstripspace -%} diff --git a/internal/tlcodegen/qt_meta.qtpl.go b/internal/tlcodegen/qt_meta.qtpl.go index ad104782..451e472c 100644 --- a/internal/tlcodegen/qt_meta.qtpl.go +++ b/internal/tlcodegen/qt_meta.qtpl.go @@ -81,8 +81,6 @@ type Object interface { type Function interface { Object - ContainsUnionTypesInResult() bool - ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error @@ -188,6 +186,9 @@ type TLItem struct { tag uint32 annotations uint32 tlName string + + resultTypeContainsUnionTypes bool + createFunction func() Function createFunctionLong func() Function createObject func() Object @@ -203,6 +204,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } +func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } + // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } func (item TLItem) CreateFunctionLong() Function { return item.createFunctionLong() } @@ -387,7 +390,11 @@ func init() { continue } if fun, ok := wr.trw.(*TypeRWStruct); ok && len(wr.NatParams) == 0 { + resultTypeContainsUnionTypes := false + if fun.ResultType != nil { + resultTypeContainsUnionTypes = fun.ResultType.trw.ContainsUnion() + qw422016.N().S(`fillFunction(`) } else { qw422016.N().S(`fillObject(`) @@ -404,7 +411,9 @@ func init() { qw422016.N().S(fmt.Sprintf("0x%x", wr.AnnotationsMask())) qw422016.N().S(`, tlName: "`) wr.tlName.StreamString(qw422016) - qw422016.N().S(`"})`) + qw422016.N().S(`", resultTypeContainsUnionTypes:`) + qw422016.N().V(resultTypeContainsUnionTypes) + qw422016.N().S(`})`) } qw422016.N().S(` `) From 08678ec8132576e2b98abefd10e06f52e899ab25 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Mon, 28 Oct 2024 16:45:42 +0300 Subject: [PATCH 06/16] update goldmaster --- .../tlcodegen/test/gen/cases/meta/meta.go | 109 ++++----- .../test/gen/goldmaster/meta/meta.go | 219 +++++++++--------- .../test/gen/goldmaster_nosplit/meta/meta.go | 219 +++++++++--------- 3 files changed, 278 insertions(+), 269 deletions(-) diff --git a/internal/tlcodegen/test/gen/cases/meta/meta.go b/internal/tlcodegen/test/gen/cases/meta/meta.go index 1cb7936c..2813d013 100644 --- a/internal/tlcodegen/test/gen/cases/meta/meta.go +++ b/internal/tlcodegen/test/gen/cases/meta/meta.go @@ -41,8 +41,6 @@ type Object interface { type Function interface { Object - ContainsUnionTypesInResult() bool - ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error @@ -129,9 +127,12 @@ func CreateObjectFromNameBytes(name string) Object { } type TLItem struct { - tag uint32 - annotations uint32 - tlName string + tag uint32 + annotations uint32 + tlName string + + resultTypeContainsUnionTypes bool + createFunction func() Function createFunctionLong func() Function createObject func() Object @@ -146,6 +147,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } +func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } + // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } func (item TLItem) CreateFunctionLong() Function { return item.createFunctionLong() } @@ -296,52 +299,52 @@ func fillFunction(n1 string, n2 string, item *TLItem) { } func init() { - fillObject("benchmarks.vruhash#d31bd0fd", "#d31bd0fd", &TLItem{tag: 0xd31bd0fd, annotations: 0x0, tlName: "benchmarks.vruhash"}) - fillObject("benchmarks.vruposition#32792c04", "#32792c04", &TLItem{tag: 0x32792c04, annotations: 0x0, tlName: "benchmarks.vruposition"}) - fillObject("benchmarks.vrutoyTopLevelContainer#fb442ca5", "#fb442ca5", &TLItem{tag: 0xfb442ca5, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainer"}) - fillObject("benchmarks.vrutoyTopLevelContainerWithDependency#c176008e", "#c176008e", &TLItem{tag: 0xc176008e, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainerWithDependency"}) - fillObject("benchmarks.vrutoytopLevelUnionBig#ef556bee", "#ef556bee", &TLItem{tag: 0xef556bee, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionBig"}) - fillObject("benchmarks.vrutoytopLevelUnionEmpty#ce27c770", "#ce27c770", &TLItem{tag: 0xce27c770, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionEmpty"}) - fillObject("cases_bytes.testArray#3762fb81", "#3762fb81", &TLItem{tag: 0x3762fb81, annotations: 0x0, tlName: "cases_bytes.testArray"}) - fillObject("cases_bytes.testDictAny#5a5fce57", "#5a5fce57", &TLItem{tag: 0x5a5fce57, annotations: 0x0, tlName: "cases_bytes.testDictAny"}) - fillObject("cases_bytes.testDictInt#453ace07", "#453ace07", &TLItem{tag: 0x453ace07, annotations: 0x0, tlName: "cases_bytes.testDictInt"}) - fillObject("cases_bytes.testDictString#6c04d6ce", "#6c04d6ce", &TLItem{tag: 0x6c04d6ce, annotations: 0x0, tlName: "cases_bytes.testDictString"}) - fillObject("cases_bytes.testDictStringString#ad69c772", "#ad69c772", &TLItem{tag: 0xad69c772, annotations: 0x0, tlName: "cases_bytes.testDictStringString"}) - fillObject("cases_bytes.testEnum1#58aad3f5", "#58aad3f5", &TLItem{tag: 0x58aad3f5, annotations: 0x0, tlName: "cases_bytes.testEnum1"}) - fillObject("cases_bytes.testEnum2#00b47add", "#00b47add", &TLItem{tag: 0x00b47add, annotations: 0x0, tlName: "cases_bytes.testEnum2"}) - fillObject("cases_bytes.testEnum3#81911ffa", "#81911ffa", &TLItem{tag: 0x81911ffa, annotations: 0x0, tlName: "cases_bytes.testEnum3"}) - fillObject("cases_bytes.testEnumContainer#32b92037", "#32b92037", &TLItem{tag: 0x32b92037, annotations: 0x0, tlName: "cases_bytes.testEnumContainer"}) - fillObject("cases_bytes.testTuple#2dd3bacf", "#2dd3bacf", &TLItem{tag: 0x2dd3bacf, annotations: 0x0, tlName: "cases_bytes.testTuple"}) - fillObject("cases_bytes.testVector#3647c8ae", "#3647c8ae", &TLItem{tag: 0x3647c8ae, annotations: 0x0, tlName: "cases_bytes.testVector"}) - fillObject("cases.myCycle1#d3ca919d", "#d3ca919d", &TLItem{tag: 0xd3ca919d, annotations: 0x0, tlName: "cases.myCycle1"}) - fillObject("cases.myCycle2#5444c9a2", "#5444c9a2", &TLItem{tag: 0x5444c9a2, annotations: 0x0, tlName: "cases.myCycle2"}) - fillObject("cases.myCycle3#7624f86b", "#7624f86b", &TLItem{tag: 0x7624f86b, annotations: 0x0, tlName: "cases.myCycle3"}) - fillObject("cases.replace7#6ccce4be", "#6ccce4be", &TLItem{tag: 0x6ccce4be, annotations: 0x0, tlName: "cases.replace7"}) - fillObject("cases.replace7plus#197858f5", "#197858f5", &TLItem{tag: 0x197858f5, annotations: 0x0, tlName: "cases.replace7plus"}) - fillObject("cases.replace7plusplus#abc39b68", "#abc39b68", &TLItem{tag: 0xabc39b68, annotations: 0x0, tlName: "cases.replace7plusplus"}) - fillObject("cases.testAllPossibleFieldConfigsContainer#e3fae936", "#e3fae936", &TLItem{tag: 0xe3fae936, annotations: 0x0, tlName: "cases.testAllPossibleFieldConfigsContainer"}) - fillObject("cases.testArray#a888030d", "#a888030d", &TLItem{tag: 0xa888030d, annotations: 0x0, tlName: "cases.testArray"}) - fillObject("cases.testBeforeReadBitValidation#9b2396db", "#9b2396db", &TLItem{tag: 0x9b2396db, annotations: 0x0, tlName: "cases.testBeforeReadBitValidation"}) - fillObject("cases.testDictAny#e29b8ae6", "#e29b8ae6", &TLItem{tag: 0xe29b8ae6, annotations: 0x0, tlName: "cases.testDictAny"}) - fillObject("cases.testDictInt#d3877643", "#d3877643", &TLItem{tag: 0xd3877643, annotations: 0x0, tlName: "cases.testDictInt"}) - fillObject("cases.testDictString#c463c79b", "#c463c79b", &TLItem{tag: 0xc463c79b, annotations: 0x0, tlName: "cases.testDictString"}) - fillObject("cases.testEnum1#6c6c55ac", "#6c6c55ac", &TLItem{tag: 0x6c6c55ac, annotations: 0x0, tlName: "cases.testEnum1"}) - fillObject("cases.testEnum2#86ea88ce", "#86ea88ce", &TLItem{tag: 0x86ea88ce, annotations: 0x0, tlName: "cases.testEnum2"}) - fillObject("cases.testEnum3#69b83e2f", "#69b83e2f", &TLItem{tag: 0x69b83e2f, annotations: 0x0, tlName: "cases.testEnum3"}) - fillObject("cases.testEnumContainer#cb684231", "#cb684231", &TLItem{tag: 0xcb684231, annotations: 0x0, tlName: "cases.testEnumContainer"}) - fillObject("cases.testLocalFieldmask#f68fd3f9", "#f68fd3f9", &TLItem{tag: 0xf68fd3f9, annotations: 0x0, tlName: "cases.testLocalFieldmask"}) - fillObject("cases.testMaybe#d6602613", "#d6602613", &TLItem{tag: 0xd6602613, annotations: 0x0, tlName: "cases.testMaybe"}) - fillObject("cases.testOutFieldMaskContainer#1850ffe4", "#1850ffe4", &TLItem{tag: 0x1850ffe4, annotations: 0x0, tlName: "cases.testOutFieldMaskContainer"}) - fillObject("cases.testRecursiveFieldMask#c58cf85e", "#c58cf85e", &TLItem{tag: 0xc58cf85e, annotations: 0x0, tlName: "cases.testRecursiveFieldMask"}) - fillObject("cases.testTuple#4b9caf8f", "#4b9caf8f", &TLItem{tag: 0x4b9caf8f, annotations: 0x0, tlName: "cases.testTuple"}) - fillObject("cases.testUnion1#4b4f09b1", "#4b4f09b1", &TLItem{tag: 0x4b4f09b1, annotations: 0x0, tlName: "cases.testUnion1"}) - fillObject("cases.testUnion2#464f96c4", "#464f96c4", &TLItem{tag: 0x464f96c4, annotations: 0x0, tlName: "cases.testUnion2"}) - fillObject("cases.testUnionContainer#4497a381", "#4497a381", &TLItem{tag: 0x4497a381, annotations: 0x0, tlName: "cases.testUnionContainer"}) - fillObject("cases.testVector#4975695c", "#4975695c", &TLItem{tag: 0x4975695c, annotations: 0x0, tlName: "cases.testVector"}) - fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int"}) - fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32"}) - fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64"}) - fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long"}) - fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string"}) - fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true"}) + fillObject("benchmarks.vruhash#d31bd0fd", "#d31bd0fd", &TLItem{tag: 0xd31bd0fd, annotations: 0x0, tlName: "benchmarks.vruhash", resultTypeContainsUnionTypes: false}) + fillObject("benchmarks.vruposition#32792c04", "#32792c04", &TLItem{tag: 0x32792c04, annotations: 0x0, tlName: "benchmarks.vruposition", resultTypeContainsUnionTypes: false}) + fillObject("benchmarks.vrutoyTopLevelContainer#fb442ca5", "#fb442ca5", &TLItem{tag: 0xfb442ca5, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainer", resultTypeContainsUnionTypes: false}) + fillObject("benchmarks.vrutoyTopLevelContainerWithDependency#c176008e", "#c176008e", &TLItem{tag: 0xc176008e, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainerWithDependency", resultTypeContainsUnionTypes: false}) + fillObject("benchmarks.vrutoytopLevelUnionBig#ef556bee", "#ef556bee", &TLItem{tag: 0xef556bee, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionBig", resultTypeContainsUnionTypes: false}) + fillObject("benchmarks.vrutoytopLevelUnionEmpty#ce27c770", "#ce27c770", &TLItem{tag: 0xce27c770, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionEmpty", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testArray#3762fb81", "#3762fb81", &TLItem{tag: 0x3762fb81, annotations: 0x0, tlName: "cases_bytes.testArray", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testDictAny#5a5fce57", "#5a5fce57", &TLItem{tag: 0x5a5fce57, annotations: 0x0, tlName: "cases_bytes.testDictAny", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testDictInt#453ace07", "#453ace07", &TLItem{tag: 0x453ace07, annotations: 0x0, tlName: "cases_bytes.testDictInt", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testDictString#6c04d6ce", "#6c04d6ce", &TLItem{tag: 0x6c04d6ce, annotations: 0x0, tlName: "cases_bytes.testDictString", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testDictStringString#ad69c772", "#ad69c772", &TLItem{tag: 0xad69c772, annotations: 0x0, tlName: "cases_bytes.testDictStringString", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testEnum1#58aad3f5", "#58aad3f5", &TLItem{tag: 0x58aad3f5, annotations: 0x0, tlName: "cases_bytes.testEnum1", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testEnum2#00b47add", "#00b47add", &TLItem{tag: 0x00b47add, annotations: 0x0, tlName: "cases_bytes.testEnum2", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testEnum3#81911ffa", "#81911ffa", &TLItem{tag: 0x81911ffa, annotations: 0x0, tlName: "cases_bytes.testEnum3", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testEnumContainer#32b92037", "#32b92037", &TLItem{tag: 0x32b92037, annotations: 0x0, tlName: "cases_bytes.testEnumContainer", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testTuple#2dd3bacf", "#2dd3bacf", &TLItem{tag: 0x2dd3bacf, annotations: 0x0, tlName: "cases_bytes.testTuple", resultTypeContainsUnionTypes: false}) + fillObject("cases_bytes.testVector#3647c8ae", "#3647c8ae", &TLItem{tag: 0x3647c8ae, annotations: 0x0, tlName: "cases_bytes.testVector", resultTypeContainsUnionTypes: false}) + fillObject("cases.myCycle1#d3ca919d", "#d3ca919d", &TLItem{tag: 0xd3ca919d, annotations: 0x0, tlName: "cases.myCycle1", resultTypeContainsUnionTypes: false}) + fillObject("cases.myCycle2#5444c9a2", "#5444c9a2", &TLItem{tag: 0x5444c9a2, annotations: 0x0, tlName: "cases.myCycle2", resultTypeContainsUnionTypes: false}) + fillObject("cases.myCycle3#7624f86b", "#7624f86b", &TLItem{tag: 0x7624f86b, annotations: 0x0, tlName: "cases.myCycle3", resultTypeContainsUnionTypes: false}) + fillObject("cases.replace7#6ccce4be", "#6ccce4be", &TLItem{tag: 0x6ccce4be, annotations: 0x0, tlName: "cases.replace7", resultTypeContainsUnionTypes: false}) + fillObject("cases.replace7plus#197858f5", "#197858f5", &TLItem{tag: 0x197858f5, annotations: 0x0, tlName: "cases.replace7plus", resultTypeContainsUnionTypes: false}) + fillObject("cases.replace7plusplus#abc39b68", "#abc39b68", &TLItem{tag: 0xabc39b68, annotations: 0x0, tlName: "cases.replace7plusplus", resultTypeContainsUnionTypes: false}) + fillObject("cases.testAllPossibleFieldConfigsContainer#e3fae936", "#e3fae936", &TLItem{tag: 0xe3fae936, annotations: 0x0, tlName: "cases.testAllPossibleFieldConfigsContainer", resultTypeContainsUnionTypes: false}) + fillObject("cases.testArray#a888030d", "#a888030d", &TLItem{tag: 0xa888030d, annotations: 0x0, tlName: "cases.testArray", resultTypeContainsUnionTypes: false}) + fillObject("cases.testBeforeReadBitValidation#9b2396db", "#9b2396db", &TLItem{tag: 0x9b2396db, annotations: 0x0, tlName: "cases.testBeforeReadBitValidation", resultTypeContainsUnionTypes: false}) + fillObject("cases.testDictAny#e29b8ae6", "#e29b8ae6", &TLItem{tag: 0xe29b8ae6, annotations: 0x0, tlName: "cases.testDictAny", resultTypeContainsUnionTypes: false}) + fillObject("cases.testDictInt#d3877643", "#d3877643", &TLItem{tag: 0xd3877643, annotations: 0x0, tlName: "cases.testDictInt", resultTypeContainsUnionTypes: false}) + fillObject("cases.testDictString#c463c79b", "#c463c79b", &TLItem{tag: 0xc463c79b, annotations: 0x0, tlName: "cases.testDictString", resultTypeContainsUnionTypes: false}) + fillObject("cases.testEnum1#6c6c55ac", "#6c6c55ac", &TLItem{tag: 0x6c6c55ac, annotations: 0x0, tlName: "cases.testEnum1", resultTypeContainsUnionTypes: false}) + fillObject("cases.testEnum2#86ea88ce", "#86ea88ce", &TLItem{tag: 0x86ea88ce, annotations: 0x0, tlName: "cases.testEnum2", resultTypeContainsUnionTypes: false}) + fillObject("cases.testEnum3#69b83e2f", "#69b83e2f", &TLItem{tag: 0x69b83e2f, annotations: 0x0, tlName: "cases.testEnum3", resultTypeContainsUnionTypes: false}) + fillObject("cases.testEnumContainer#cb684231", "#cb684231", &TLItem{tag: 0xcb684231, annotations: 0x0, tlName: "cases.testEnumContainer", resultTypeContainsUnionTypes: false}) + fillObject("cases.testLocalFieldmask#f68fd3f9", "#f68fd3f9", &TLItem{tag: 0xf68fd3f9, annotations: 0x0, tlName: "cases.testLocalFieldmask", resultTypeContainsUnionTypes: false}) + fillObject("cases.testMaybe#d6602613", "#d6602613", &TLItem{tag: 0xd6602613, annotations: 0x0, tlName: "cases.testMaybe", resultTypeContainsUnionTypes: false}) + fillObject("cases.testOutFieldMaskContainer#1850ffe4", "#1850ffe4", &TLItem{tag: 0x1850ffe4, annotations: 0x0, tlName: "cases.testOutFieldMaskContainer", resultTypeContainsUnionTypes: false}) + fillObject("cases.testRecursiveFieldMask#c58cf85e", "#c58cf85e", &TLItem{tag: 0xc58cf85e, annotations: 0x0, tlName: "cases.testRecursiveFieldMask", resultTypeContainsUnionTypes: false}) + fillObject("cases.testTuple#4b9caf8f", "#4b9caf8f", &TLItem{tag: 0x4b9caf8f, annotations: 0x0, tlName: "cases.testTuple", resultTypeContainsUnionTypes: false}) + fillObject("cases.testUnion1#4b4f09b1", "#4b4f09b1", &TLItem{tag: 0x4b4f09b1, annotations: 0x0, tlName: "cases.testUnion1", resultTypeContainsUnionTypes: false}) + fillObject("cases.testUnion2#464f96c4", "#464f96c4", &TLItem{tag: 0x464f96c4, annotations: 0x0, tlName: "cases.testUnion2", resultTypeContainsUnionTypes: false}) + fillObject("cases.testUnionContainer#4497a381", "#4497a381", &TLItem{tag: 0x4497a381, annotations: 0x0, tlName: "cases.testUnionContainer", resultTypeContainsUnionTypes: false}) + fillObject("cases.testVector#4975695c", "#4975695c", &TLItem{tag: 0x4975695c, annotations: 0x0, tlName: "cases.testVector", resultTypeContainsUnionTypes: false}) + fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false}) + fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false}) + fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false}) + fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false}) + fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) + fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false}) } diff --git a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go index 37a437bf..ce068287 100644 --- a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go @@ -43,8 +43,6 @@ type Object interface { type Function interface { Object - ContainsUnionTypesInResult() bool - ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error @@ -131,9 +129,12 @@ func CreateObjectFromNameBytes(name string) Object { } type TLItem struct { - tag uint32 - annotations uint32 - tlName string + tag uint32 + annotations uint32 + tlName string + + resultTypeContainsUnionTypes bool + createFunction func() Function createFunctionLong func() Function createObject func() Object @@ -148,6 +149,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } +func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } + // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } func (item TLItem) CreateFunctionLong() Function { return item.createFunctionLong() } @@ -300,107 +303,107 @@ func fillFunction(n1 string, n2 string, item *TLItem) { } func init() { - fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue"}) - fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color"}) - fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green"}) - fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red"}) - fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2"}) - fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA"}) - fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias"}) - fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1"}) - fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2"}) - fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3"}) - fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4"}) - fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5"}) - fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6"}) - fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7"}) - fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8"}) - fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9"}) - fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code"}) - fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany"}) - fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne"}) - fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty"}) - fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType"}) - fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe"}) - fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1"}) - fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2"}) - fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA"}) - fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB"}) - fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC"}) - fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD"}) - fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle"}) - fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString"}) - fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA"}) - fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red"}) - fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1"}) - fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2"}) - fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3"}) - fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4"}) - fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5"}) - fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6"}) - fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7"}) - fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8"}) - fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9"}) - fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType"}) - fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response"}) - fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3"}) - fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA"}) - fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB"}) - fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC"}) - fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD"}) - fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle"}) - fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle"}) - fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle"}) - fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle"}) - fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple"}) - fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr"}) - fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren"}) - fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int"}) - fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32"}) - fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64"}) - fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long"}) - fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1"}) - fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint"}) - fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32"}) - fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64"}) - fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat"}) - fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus"}) - fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3"}) - fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero"}) - fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3"}) - fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers"}) - fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr"}) - fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace"}) - fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10"}) - fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12"}) - fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15"}) - fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17"}) - fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18"}) - fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2"}) - fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3"}) - fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5"}) - fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6"}) - fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7"}) - fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8"}) - fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9"}) - fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput"}) - fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert"}) - fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput"}) - fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert"}) - fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput"}) - fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput"}) - fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string"}) - fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe"}) - fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2"}) - fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true"}) - fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA"}) - fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB"}) - fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC"}) - fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD"}) - fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse"}) - fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly"}) - fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse"}) - fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr"}) - fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue"}) - fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity"}) + fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue", resultTypeContainsUnionTypes: false}) + fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color", resultTypeContainsUnionTypes: false}) + fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green", resultTypeContainsUnionTypes: false}) + fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red", resultTypeContainsUnionTypes: false}) + fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2", resultTypeContainsUnionTypes: false}) + fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false}) + fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9", resultTypeContainsUnionTypes: false}) + fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code", resultTypeContainsUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany", resultTypeContainsUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne", resultTypeContainsUnionTypes: false}) + fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty", resultTypeContainsUnionTypes: false}) + fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType", resultTypeContainsUnionTypes: false}) + fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe", resultTypeContainsUnionTypes: false}) + fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1", resultTypeContainsUnionTypes: false}) + fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD", resultTypeContainsUnionTypes: false}) + fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle", resultTypeContainsUnionTypes: false}) + fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString", resultTypeContainsUnionTypes: false}) + fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA", resultTypeContainsUnionTypes: false}) + fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red", resultTypeContainsUnionTypes: false}) + fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1", resultTypeContainsUnionTypes: false}) + fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2", resultTypeContainsUnionTypes: false}) + fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3", resultTypeContainsUnionTypes: false}) + fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4", resultTypeContainsUnionTypes: false}) + fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5", resultTypeContainsUnionTypes: false}) + fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6", resultTypeContainsUnionTypes: false}) + fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7", resultTypeContainsUnionTypes: false}) + fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8", resultTypeContainsUnionTypes: false}) + fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9", resultTypeContainsUnionTypes: false}) + fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType", resultTypeContainsUnionTypes: false}) + fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response", resultTypeContainsUnionTypes: false}) + fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD", resultTypeContainsUnionTypes: false}) + fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle", resultTypeContainsUnionTypes: false}) + fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle", resultTypeContainsUnionTypes: false}) + fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle", resultTypeContainsUnionTypes: false}) + fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle", resultTypeContainsUnionTypes: false}) + fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple", resultTypeContainsUnionTypes: false}) + fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr", resultTypeContainsUnionTypes: false}) + fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren", resultTypeContainsUnionTypes: false}) + fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false}) + fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false}) + fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false}) + fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false}) + fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1", resultTypeContainsUnionTypes: false}) + fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint", resultTypeContainsUnionTypes: false}) + fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32", resultTypeContainsUnionTypes: false}) + fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64", resultTypeContainsUnionTypes: false}) + fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat", resultTypeContainsUnionTypes: false}) + fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus", resultTypeContainsUnionTypes: false}) + fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3", resultTypeContainsUnionTypes: false}) + fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero", resultTypeContainsUnionTypes: false}) + fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3", resultTypeContainsUnionTypes: false}) + fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers", resultTypeContainsUnionTypes: false}) + fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr", resultTypeContainsUnionTypes: false}) + fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace", resultTypeContainsUnionTypes: false}) + fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10", resultTypeContainsUnionTypes: false}) + fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12", resultTypeContainsUnionTypes: false}) + fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15", resultTypeContainsUnionTypes: false}) + fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17", resultTypeContainsUnionTypes: false}) + fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18", resultTypeContainsUnionTypes: false}) + fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2", resultTypeContainsUnionTypes: false}) + fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3", resultTypeContainsUnionTypes: false}) + fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5", resultTypeContainsUnionTypes: false}) + fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6", resultTypeContainsUnionTypes: false}) + fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7", resultTypeContainsUnionTypes: false}) + fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false}) + fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false}) + fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false}) + fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true}) + fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false}) + fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true}) + fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false}) + fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false}) + fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) + fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe", resultTypeContainsUnionTypes: false}) + fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2", resultTypeContainsUnionTypes: false}) + fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false}) + fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA", resultTypeContainsUnionTypes: false}) + fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB", resultTypeContainsUnionTypes: false}) + fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC", resultTypeContainsUnionTypes: false}) + fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD", resultTypeContainsUnionTypes: false}) + fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse", resultTypeContainsUnionTypes: false}) + fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly", resultTypeContainsUnionTypes: false}) + fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse", resultTypeContainsUnionTypes: false}) + fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr", resultTypeContainsUnionTypes: false}) + fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue", resultTypeContainsUnionTypes: false}) + fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity", resultTypeContainsUnionTypes: false}) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go index 97fa63e9..d1a0d028 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go @@ -43,8 +43,6 @@ type Object interface { type Function interface { Object - ContainsUnionTypesInResult() bool - ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error @@ -131,9 +129,12 @@ func CreateObjectFromNameBytes(name string) Object { } type TLItem struct { - tag uint32 - annotations uint32 - tlName string + tag uint32 + annotations uint32 + tlName string + + resultTypeContainsUnionTypes bool + createFunction func() Function createFunctionLong func() Function createObject func() Object @@ -148,6 +149,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } +func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } + // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } func (item TLItem) CreateFunctionLong() Function { return item.createFunctionLong() } @@ -300,107 +303,107 @@ func fillFunction(n1 string, n2 string, item *TLItem) { } func init() { - fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue"}) - fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color"}) - fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green"}) - fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red"}) - fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2"}) - fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA"}) - fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias"}) - fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1"}) - fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2"}) - fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3"}) - fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4"}) - fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5"}) - fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6"}) - fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7"}) - fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8"}) - fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9"}) - fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code"}) - fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany"}) - fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne"}) - fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty"}) - fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType"}) - fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe"}) - fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1"}) - fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2"}) - fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA"}) - fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB"}) - fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC"}) - fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD"}) - fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle"}) - fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString"}) - fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA"}) - fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red"}) - fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1"}) - fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2"}) - fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3"}) - fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4"}) - fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5"}) - fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6"}) - fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7"}) - fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8"}) - fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9"}) - fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType"}) - fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response"}) - fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3"}) - fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA"}) - fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB"}) - fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC"}) - fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD"}) - fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle"}) - fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle"}) - fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle"}) - fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle"}) - fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple"}) - fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr"}) - fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren"}) - fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int"}) - fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32"}) - fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64"}) - fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long"}) - fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1"}) - fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint"}) - fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32"}) - fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64"}) - fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat"}) - fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus"}) - fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3"}) - fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero"}) - fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3"}) - fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers"}) - fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr"}) - fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace"}) - fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10"}) - fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12"}) - fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15"}) - fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17"}) - fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18"}) - fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2"}) - fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3"}) - fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5"}) - fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6"}) - fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7"}) - fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8"}) - fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9"}) - fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput"}) - fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert"}) - fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput"}) - fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert"}) - fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput"}) - fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput"}) - fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string"}) - fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe"}) - fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2"}) - fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true"}) - fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA"}) - fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB"}) - fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC"}) - fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD"}) - fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse"}) - fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly"}) - fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse"}) - fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr"}) - fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue"}) - fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity"}) + fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue", resultTypeContainsUnionTypes: false}) + fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color", resultTypeContainsUnionTypes: false}) + fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green", resultTypeContainsUnionTypes: false}) + fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red", resultTypeContainsUnionTypes: false}) + fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2", resultTypeContainsUnionTypes: false}) + fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false}) + fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9", resultTypeContainsUnionTypes: false}) + fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code", resultTypeContainsUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany", resultTypeContainsUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne", resultTypeContainsUnionTypes: false}) + fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty", resultTypeContainsUnionTypes: false}) + fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType", resultTypeContainsUnionTypes: false}) + fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe", resultTypeContainsUnionTypes: false}) + fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1", resultTypeContainsUnionTypes: false}) + fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC", resultTypeContainsUnionTypes: false}) + fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD", resultTypeContainsUnionTypes: false}) + fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle", resultTypeContainsUnionTypes: false}) + fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString", resultTypeContainsUnionTypes: false}) + fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA", resultTypeContainsUnionTypes: false}) + fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red", resultTypeContainsUnionTypes: false}) + fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1", resultTypeContainsUnionTypes: false}) + fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2", resultTypeContainsUnionTypes: false}) + fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3", resultTypeContainsUnionTypes: false}) + fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4", resultTypeContainsUnionTypes: false}) + fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5", resultTypeContainsUnionTypes: false}) + fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6", resultTypeContainsUnionTypes: false}) + fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7", resultTypeContainsUnionTypes: false}) + fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8", resultTypeContainsUnionTypes: false}) + fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9", resultTypeContainsUnionTypes: false}) + fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType", resultTypeContainsUnionTypes: false}) + fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response", resultTypeContainsUnionTypes: false}) + fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC", resultTypeContainsUnionTypes: false}) + fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD", resultTypeContainsUnionTypes: false}) + fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle", resultTypeContainsUnionTypes: false}) + fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle", resultTypeContainsUnionTypes: false}) + fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle", resultTypeContainsUnionTypes: false}) + fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle", resultTypeContainsUnionTypes: false}) + fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple", resultTypeContainsUnionTypes: false}) + fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr", resultTypeContainsUnionTypes: false}) + fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren", resultTypeContainsUnionTypes: false}) + fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false}) + fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false}) + fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false}) + fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false}) + fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1", resultTypeContainsUnionTypes: false}) + fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint", resultTypeContainsUnionTypes: false}) + fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32", resultTypeContainsUnionTypes: false}) + fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64", resultTypeContainsUnionTypes: false}) + fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat", resultTypeContainsUnionTypes: false}) + fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus", resultTypeContainsUnionTypes: false}) + fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3", resultTypeContainsUnionTypes: false}) + fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero", resultTypeContainsUnionTypes: false}) + fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3", resultTypeContainsUnionTypes: false}) + fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers", resultTypeContainsUnionTypes: false}) + fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr", resultTypeContainsUnionTypes: false}) + fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace", resultTypeContainsUnionTypes: false}) + fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10", resultTypeContainsUnionTypes: false}) + fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12", resultTypeContainsUnionTypes: false}) + fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15", resultTypeContainsUnionTypes: false}) + fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17", resultTypeContainsUnionTypes: false}) + fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18", resultTypeContainsUnionTypes: false}) + fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2", resultTypeContainsUnionTypes: false}) + fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3", resultTypeContainsUnionTypes: false}) + fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5", resultTypeContainsUnionTypes: false}) + fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6", resultTypeContainsUnionTypes: false}) + fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7", resultTypeContainsUnionTypes: false}) + fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false}) + fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false}) + fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false}) + fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true}) + fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false}) + fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true}) + fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false}) + fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false}) + fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) + fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe", resultTypeContainsUnionTypes: false}) + fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2", resultTypeContainsUnionTypes: false}) + fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false}) + fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA", resultTypeContainsUnionTypes: false}) + fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB", resultTypeContainsUnionTypes: false}) + fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC", resultTypeContainsUnionTypes: false}) + fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD", resultTypeContainsUnionTypes: false}) + fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse", resultTypeContainsUnionTypes: false}) + fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly", resultTypeContainsUnionTypes: false}) + fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse", resultTypeContainsUnionTypes: false}) + fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr", resultTypeContainsUnionTypes: false}) + fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue", resultTypeContainsUnionTypes: false}) + fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity", resultTypeContainsUnionTypes: false}) } From c1ff3f5324fe7ed1c67c57d9912e70c7be412778 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 10:56:21 +0300 Subject: [PATCH 07/16] fix logic for detection unions with adding visitedNodes --- internal/tlcodegen/qt_meta.qtpl | 4 ++-- internal/tlcodegen/qt_meta.qtpl.go | 4 ++-- internal/tlcodegen/qt_struct.qtpl | 5 ----- internal/tlcodegen/qt_struct.qtpl.go | 11 +---------- internal/tlcodegen/type_rw.go | 19 ++++++++++++++++++- internal/tlcodegen/type_rw_bool.go | 2 +- internal/tlcodegen/type_rw_maybe.go | 4 ++-- internal/tlcodegen/type_rw_primitive.go | 2 +- internal/tlcodegen/type_rw_struct.go | 4 ++-- internal/tlcodegen/type_rw_tuple.go | 4 ++-- internal/tlcodegen/type_rw_union.go | 2 +- 11 files changed, 32 insertions(+), 29 deletions(-) diff --git a/internal/tlcodegen/qt_meta.qtpl b/internal/tlcodegen/qt_meta.qtpl index 9b8a7302..bf221fc0 100644 --- a/internal/tlcodegen/qt_meta.qtpl +++ b/internal/tlcodegen/qt_meta.qtpl @@ -165,7 +165,7 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -342,7 +342,7 @@ func init() { {%- if fun, ok := wr.trw.(*TypeRWStruct); ok && len(wr.NatParams) == 0 -%} {%- code resultTypeContainsUnionTypes := false -%} {%- if fun.ResultType != nil -%} - {%- code resultTypeContainsUnionTypes = fun.ResultType.trw.ContainsUnion() -%} + {%- code resultTypeContainsUnionTypes = fun.wr.DoesReturnTypeContainUnionTypes() -%} fillFunction( {%- else -%} fillObject( diff --git a/internal/tlcodegen/qt_meta.qtpl.go b/internal/tlcodegen/qt_meta.qtpl.go index 451e472c..324caf3c 100644 --- a/internal/tlcodegen/qt_meta.qtpl.go +++ b/internal/tlcodegen/qt_meta.qtpl.go @@ -204,7 +204,7 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -393,7 +393,7 @@ func init() { resultTypeContainsUnionTypes := false if fun.ResultType != nil { - resultTypeContainsUnionTypes = fun.ResultType.trw.ContainsUnion() + resultTypeContainsUnionTypes = fun.wr.DoesReturnTypeContainUnionTypes() qw422016.N().S(`fillFunction(`) } else { diff --git a/internal/tlcodegen/qt_struct.qtpl b/internal/tlcodegen/qt_struct.qtpl index 939aae7a..b71f76e5 100644 --- a/internal/tlcodegen/qt_struct.qtpl +++ b/internal/tlcodegen/qt_struct.qtpl @@ -744,11 +744,6 @@ vru.replicaState#3d74578e fields_mask:# pre_vote_demote :fields_mask.10?string goName := addBytes(struct_.wr.goGlobalName, bytesVersion) retArg := struct_.ResultType.TypeString2(bytesVersion, directImports, struct_.wr.ins, false, false) -%} - -func (item *{%s= goName %}) ContainsUnionTypesInResult() bool { - return {%v= struct_.ResultType.trw.ContainsUnion() %} -} - func (item *{%s= goName %}) ReadResult(w []byte, ret *{%s= retArg %}) (_ []byte, err error) { {%s= struct_.ResultType.TypeReadingCode(bytesVersion, directImports, struct_.wr.ins, "ret", false, formatNatArgs(struct_.Fields, struct_.ResultNatArgs), true, true) %} } diff --git a/internal/tlcodegen/qt_struct.qtpl.go b/internal/tlcodegen/qt_struct.qtpl.go index 2385da25..9bf7c849 100644 --- a/internal/tlcodegen/qt_struct.qtpl.go +++ b/internal/tlcodegen/qt_struct.qtpl.go @@ -1575,16 +1575,7 @@ func (struct_ *TypeRWStruct) streamfunctionCode(qw422016 *qt422016.Writer, bytes goName := addBytes(struct_.wr.goGlobalName, bytesVersion) retArg := struct_.ResultType.TypeString2(bytesVersion, directImports, struct_.wr.ins, false, false) - qw422016.N().S(` -func (item *`) - qw422016.N().S(goName) - qw422016.N().S(`) ContainsUnionTypesInResult() bool { - return `) - qw422016.N().V(struct_.ResultType.trw.ContainsUnion()) - qw422016.N().S(` -} - -func (item *`) + qw422016.N().S(`func (item *`) qw422016.N().S(goName) qw422016.N().S(`) ReadResult(w []byte, ret *`) qw422016.N().S(retArg) diff --git a/internal/tlcodegen/type_rw.go b/internal/tlcodegen/type_rw.go index f59b3b08..9249e22e 100644 --- a/internal/tlcodegen/type_rw.go +++ b/internal/tlcodegen/type_rw.go @@ -165,6 +165,23 @@ func (w *TypeRWWrapper) AnnotationsMask() uint32 { return mask } +func (w *TypeRWWrapper) DoesReturnTypeContainUnionTypes() bool { + if w, ok := w.trw.(*TypeRWStruct); ok && w.ResultType != nil { + return w.ResultType.containsUnion(map[*TypeRWWrapper]bool{}) + } else { + return false + } +} + +func (w *TypeRWWrapper) containsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { + if _, ok := visitedNodes[w]; !ok { + visitedNodes[w] = false + return w.trw.ContainsUnion(visitedNodes) + } else { + return false + } +} + // Assign structural names to external arguments func (w *TypeRWWrapper) NatArgs(result []ActualNatArg, prefix string) []ActualNatArg { for i, a := range w.arguments { @@ -709,7 +726,7 @@ type TypeRW interface { AllPossibleRecursionProducers() []*TypeRWWrapper AllTypeDependencies(generic, countFunctions bool) []*TypeRWWrapper IsWrappingType() bool - ContainsUnion() bool + ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool BeforeCodeGenerationStep1() // during first phase, some wr.trw are nil due to recursive types. So we delay some BeforeCodeGenerationStep2() // during second phase, union fields recursive bit is set diff --git a/internal/tlcodegen/type_rw_bool.go b/internal/tlcodegen/type_rw_bool.go index fd0c33b7..5093806d 100644 --- a/internal/tlcodegen/type_rw_bool.go +++ b/internal/tlcodegen/type_rw_bool.go @@ -54,7 +54,7 @@ func (trw *TypeRWBool) IsWrappingType() bool { return true } -func (trw *TypeRWBool) ContainsUnion() bool { +func (trw *TypeRWBool) ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { return false } diff --git a/internal/tlcodegen/type_rw_maybe.go b/internal/tlcodegen/type_rw_maybe.go index 60f23fdf..b2068e4f 100644 --- a/internal/tlcodegen/type_rw_maybe.go +++ b/internal/tlcodegen/type_rw_maybe.go @@ -55,8 +55,8 @@ func (trw *TypeRWMaybe) IsWrappingType() bool { return true } -func (trw *TypeRWMaybe) ContainsUnion() bool { - return false +func (trw *TypeRWMaybe) ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { + return trw.element.t.containsUnion(visitedNodes) } func (trw *TypeRWMaybe) FillRecursiveChildren(visitedNodes map[*TypeRWWrapper]int, generic bool) { diff --git a/internal/tlcodegen/type_rw_primitive.go b/internal/tlcodegen/type_rw_primitive.go index 3dec0bab..b789a0ab 100644 --- a/internal/tlcodegen/type_rw_primitive.go +++ b/internal/tlcodegen/type_rw_primitive.go @@ -70,7 +70,7 @@ func (trw *TypeRWPrimitive) IsWrappingType() bool { return true } -func (trw *TypeRWPrimitive) ContainsUnion() bool { +func (trw *TypeRWPrimitive) ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { return false } diff --git a/internal/tlcodegen/type_rw_struct.go b/internal/tlcodegen/type_rw_struct.go index be5f6a36..8d4f5058 100644 --- a/internal/tlcodegen/type_rw_struct.go +++ b/internal/tlcodegen/type_rw_struct.go @@ -185,9 +185,9 @@ func (trw *TypeRWStruct) IsWrappingType() bool { return trw.isUnwrapType() } -func (trw *TypeRWStruct) ContainsUnion() bool { +func (trw *TypeRWStruct) ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { for _, f := range trw.Fields { - if f.t.trw.ContainsUnion() { + if f.t.containsUnion(visitedNodes) { return true } } diff --git a/internal/tlcodegen/type_rw_tuple.go b/internal/tlcodegen/type_rw_tuple.go index 0139720a..77578557 100644 --- a/internal/tlcodegen/type_rw_tuple.go +++ b/internal/tlcodegen/type_rw_tuple.go @@ -108,8 +108,8 @@ func (trw *TypeRWBrackets) IsWrappingType() bool { return false } -func (trw *TypeRWBrackets) ContainsUnion() bool { - return false +func (trw *TypeRWBrackets) ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { + return trw.element.t.containsUnion(visitedNodes) } func (trw *TypeRWBrackets) BeforeCodeGenerationStep1() { diff --git a/internal/tlcodegen/type_rw_union.go b/internal/tlcodegen/type_rw_union.go index 30a8ac36..21e5bf18 100644 --- a/internal/tlcodegen/type_rw_union.go +++ b/internal/tlcodegen/type_rw_union.go @@ -87,7 +87,7 @@ func (trw *TypeRWUnion) IsWrappingType() bool { return false } -func (trw *TypeRWUnion) ContainsUnion() bool { +func (trw *TypeRWUnion) ContainsUnion(visitedNodes map[*TypeRWWrapper]bool) bool { return true } From 1818d37af02187b5386bb5d0de44519628e17279 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 10:57:03 +0300 Subject: [PATCH 08/16] add specific list type add method which returns it --- internal/tlcodegen/test/tls/goldmaster.tl | 3 +++ internal/tlcodegen/test/tls/goldmaster2.tl | 2 ++ internal/tlcodegen/test/tls/goldmaster_canonical.tl | 2 ++ 3 files changed, 7 insertions(+) diff --git a/internal/tlcodegen/test/tls/goldmaster.tl b/internal/tlcodegen/test/tls/goldmaster.tl index ceaf29bc..503e55d9 100644 --- a/internal/tlcodegen/test/tls/goldmaster.tl +++ b/internal/tlcodegen/test/tls/goldmaster.tl @@ -50,6 +50,9 @@ dictionaryAny#1f4c6190 {k:Type} {v:Type} # [(dictionaryFieldAny k v)] = Dictiona true = True; // this can be used as void type and serialized to empty array in PHP useTrue#dfdd4180 fm:# a:fm.0?true b:fm.1?True c:true d:True e:fm.2?Bool = UseTrue; // we give warnings for many fields of this kind +//---- test recursive struct without union as result +list {X:Type} flag:# head:flag.0?X tail:flag.0?(list X) = List X; + //---- test bytes version propagation noStr x:int = NoStr; useStr x:string = UseStr; diff --git a/internal/tlcodegen/test/tls/goldmaster2.tl b/internal/tlcodegen/test/tls/goldmaster2.tl index 87a2947c..099e9ac0 100644 --- a/internal/tlcodegen/test/tls/goldmaster2.tl +++ b/internal/tlcodegen/test/tls/goldmaster2.tl @@ -10,6 +10,8 @@ @read call9 x:typeA = TypeB; @readwrite service5.insert#7cf362ba flags:# persistent:flags.0?%True = service5.Output; +@readwrite service5.insertList#7cf362bc flags:# persistent:flags.0?%True = List; + @readwrite service5Long.insert#7cf362bb flags:# persistent:flags.0?%True = service5Long.Output; ---types--- diff --git a/internal/tlcodegen/test/tls/goldmaster_canonical.tl b/internal/tlcodegen/test/tls/goldmaster_canonical.tl index 3a9b415e..498b6b98 100644 --- a/internal/tlcodegen/test/tls/goldmaster_canonical.tl +++ b/internal/tlcodegen/test/tls/goldmaster_canonical.tl @@ -24,6 +24,7 @@ dictionaryFieldAny#2c43a65b k:Type v:Type key:k value:v = DictionaryFieldAny k v dictionaryAny#1f4c6190 k:Type v:Type # [ (dictionaryFieldAny k v) ] = DictionaryAny k v // ./internal/tlcodegen/test/tls/goldmaster.tl true#3fedd339 = True // ./internal/tlcodegen/test/tls/goldmaster.tl useTrue#dfdd4180 fm:# a:fm.0?true b:fm.1?True c:true d:True e:fm.2?Bool = UseTrue // ./internal/tlcodegen/test/tls/goldmaster.tl +list#02d80cdd X:Type flag:# head:flag.0?X tail:flag.0?list X = List X // ./internal/tlcodegen/test/tls/goldmaster.tl noStr#3a728324 x:int = NoStr // ./internal/tlcodegen/test/tls/goldmaster.tl useStr#9aa3dee5 x:string = UseStr // ./internal/tlcodegen/test/tls/goldmaster.tl halfStr#647ddaf5 x:noStr y:useStr = HalfStr // ./internal/tlcodegen/test/tls/goldmaster.tl @@ -133,5 +134,6 @@ service5Long.stringOutput#dc170ff5 http_code:long response:string = service5Long @read call8#7b400184 x:typeA = cd.TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl @read call9#67a0d62d x:typeA = TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl @readwrite service5.insert#7cf362ba flags:# persistent:flags.0?%True = service5.Output // ./internal/tlcodegen/test/tls/goldmaster2.tl +@readwrite service5.insertList#7cf362bc flags:# persistent:flags.0?%True = List service5.Output // ./internal/tlcodegen/test/tls/goldmaster2.tl @readwrite service5Long.insert#7cf362bb flags:# persistent:flags.0?%True = service5Long.Output // ./internal/tlcodegen/test/tls/goldmaster2.tl aaa#05b0e500 A:# T:Type U:Type a:# B:# A0:A.0?string A1:A.1?string a0:a.0?string a1:a.1?string B0:B.0?string B1:B.1?U = Aaa A T U // ./internal/tlcodegen/test/tls/goldmaster3.tl From 62f484c2aa3a71a9b31d23193d05a506c598e4f2 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 10:57:18 +0300 Subject: [PATCH 09/16] update goldmaster --- .../tlcodegen/test/gen/cases/meta/meta.go | 2 +- .../gen/goldmaster/constants/constants.go | 2 + .../test/gen/goldmaster/factory/factory.go | 2 + .../goldmaster/factory_bytes/factory_bytes.go | 2 + .../goldmaster/internal/tl/tlCall1/call1.go | 4 - .../goldmaster/internal/tl/tlCall2/call2.go | 4 - .../goldmaster/internal/tl/tlCall3/call3.go | 4 - .../goldmaster/internal/tl/tlCall4/call4.go | 4 - .../goldmaster/internal/tl/tlCall5/call5.go | 4 - .../goldmaster/internal/tl/tlCall6/call6.go | 4 - .../goldmaster/internal/tl/tlCall7/call7.go | 4 - .../goldmaster/internal/tl/tlCall8/call8.go | 4 - .../goldmaster/internal/tl/tlCall9/call9.go | 4 - .../internal/tlab/tlAbCall1/ab.call1.go | 4 - .../internal/tlab/tlAbCall2/ab.call2.go | 4 - .../internal/tlab/tlAbCall3/ab.call3.go | 4 - .../internal/tlab/tlAbCall4/ab.call4.go | 4 - .../internal/tlab/tlAbCall5/ab.call5.go | 4 - .../internal/tlab/tlAbCall6/ab.call6.go | 4 - .../internal/tlab/tlAbCall7/ab.call7.go | 4 - .../internal/tlab/tlAbCall8/ab.call8.go | 4 - .../internal/tlab/tlAbCall9/ab.call9.go | 4 - .../tlService5Insert/service5.insert.go | 4 - .../service5Long.insert.go | 4 - .../usefulService.getUserEntity.go | 4 - .../test/gen/goldmaster/meta/meta.go | 3 +- .../tlcodegen/test/gen/goldmaster/tl/tl.go | 2 + .../tlcodegen/test/gen/goldmaster/tljson.html | 79 +++++++++++++++++++ .../gen/goldmaster/tlservice5/tlservice5.go | 2 + .../goldmaster_nosplit/internal/ab.call1.go | 4 - .../goldmaster_nosplit/internal/ab.call2.go | 4 - .../goldmaster_nosplit/internal/ab.call3.go | 4 - .../goldmaster_nosplit/internal/ab.call4.go | 4 - .../goldmaster_nosplit/internal/ab.call5.go | 4 - .../goldmaster_nosplit/internal/ab.call6.go | 4 - .../goldmaster_nosplit/internal/ab.call7.go | 4 - .../goldmaster_nosplit/internal/ab.call8.go | 4 - .../goldmaster_nosplit/internal/ab.call9.go | 4 - .../gen/goldmaster_nosplit/internal/call1.go | 4 - .../gen/goldmaster_nosplit/internal/call2.go | 4 - .../gen/goldmaster_nosplit/internal/call3.go | 4 - .../gen/goldmaster_nosplit/internal/call4.go | 4 - .../gen/goldmaster_nosplit/internal/call5.go | 4 - .../gen/goldmaster_nosplit/internal/call6.go | 4 - .../gen/goldmaster_nosplit/internal/call7.go | 4 - .../gen/goldmaster_nosplit/internal/call8.go | 4 - .../gen/goldmaster_nosplit/internal/call9.go | 4 - .../internal/service5.insert.go | 4 - .../internal/service5Long.insert.go | 4 - .../internal/usefulService.getUserEntity.go | 4 - .../test/gen/goldmaster_nosplit/meta/meta.go | 6 +- 51 files changed, 95 insertions(+), 173 deletions(-) diff --git a/internal/tlcodegen/test/gen/cases/meta/meta.go b/internal/tlcodegen/test/gen/cases/meta/meta.go index 2813d013..d017ce5a 100644 --- a/internal/tlcodegen/test/gen/cases/meta/meta.go +++ b/internal/tlcodegen/test/gen/cases/meta/meta.go @@ -147,7 +147,7 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } diff --git a/internal/tlcodegen/test/gen/goldmaster/constants/constants.go b/internal/tlcodegen/test/gen/goldmaster/constants/constants.go index c75b695a..7bc0e677 100644 --- a/internal/tlcodegen/test/gen/goldmaster/constants/constants.go +++ b/internal/tlcodegen/test/gen/goldmaster/constants/constants.go @@ -82,6 +82,7 @@ const ( Int = 0xa8509bda // int Int32 = 0x7934e71f // int32 Int64 = 0xf5609de0 // int64 + List = 0x02d80cdd // list Long = 0x22076cba // long MaybeTest1 = 0xc457763c // maybeTest1 MaybeWrapper = 0x723390c4 // maybeWrapper @@ -118,6 +119,7 @@ const ( ResultTrue = 0x3f9c8ef8 // resultTrue Service5EmptyOutput = 0xff8f7db8 // service5.emptyOutput Service5Insert = 0x7cf362ba // service5.insert + Service5InsertList = 0x7cf362bc // service5.insertList Service5StringOutput = 0xdc170ff4 // service5.stringOutput Service5LongEmptyOutput = 0xff8f7db9 // service5Long.emptyOutput Service5LongInsert = 0x7cf362bb // service5Long.insert diff --git a/internal/tlcodegen/test/gen/goldmaster/factory/factory.go b/internal/tlcodegen/test/gen/goldmaster/factory/factory.go index 491ea633..04a11d8f 100644 --- a/internal/tlcodegen/test/gen/goldmaster/factory/factory.go +++ b/internal/tlcodegen/test/gen/goldmaster/factory/factory.go @@ -93,6 +93,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlcd/tlCdTypeD" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlcd/tlCdUseCycle" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/meta" @@ -208,6 +209,7 @@ func init() { meta.SetGlobalFactoryCreateForObject(0x95d598c5, func() meta.Object { var ret tlReplace9.Replace9; return &ret }) meta.SetGlobalFactoryCreateForObject(0xff8f7db8, func() meta.Object { var ret cycle_16847572a0831d4cd4c0c0fb513151f3.Service5EmptyOutput; return &ret }) meta.SetGlobalFactoryCreateForFunction(0x7cf362ba, func() meta.Object { var ret tlService5Insert.Service5Insert; return &ret }, func() meta.Function { var ret tlService5Insert.Service5Insert; return &ret }, func() meta.Function { var ret tlService5LongInsert.Service5LongInsert; return &ret }) + meta.SetGlobalFactoryCreateForFunction(0x7cf362bc, func() meta.Object { var ret tlService5InsertList.Service5InsertList; return &ret }, func() meta.Function { var ret tlService5InsertList.Service5InsertList; return &ret }, nil) meta.SetGlobalFactoryCreateForObject(0xff8f7db9, func() meta.Object { var ret cycle_98d4570147919cfd6f6ebfc47c3e10a0.Service5LongEmptyOutput return &ret diff --git a/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go b/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go index 7fceb6e7..1af8918b 100644 --- a/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go +++ b/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go @@ -93,6 +93,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlcd/tlCdTypeD" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlcd/tlCdUseCycle" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/meta" @@ -208,6 +209,7 @@ func init() { meta.SetGlobalFactoryCreateForObjectBytes(0x95d598c5, func() meta.Object { var ret tlReplace9.Replace9; return &ret }) meta.SetGlobalFactoryCreateForObjectBytes(0xff8f7db8, func() meta.Object { var ret cycle_16847572a0831d4cd4c0c0fb513151f3.Service5EmptyOutput; return &ret }) meta.SetGlobalFactoryCreateForFunctionBytes(0x7cf362ba, func() meta.Object { var ret tlService5Insert.Service5Insert; return &ret }, func() meta.Function { var ret tlService5Insert.Service5Insert; return &ret }, func() meta.Function { var ret tlService5LongInsert.Service5LongInsert; return &ret }) + meta.SetGlobalFactoryCreateForFunctionBytes(0x7cf362bc, func() meta.Object { var ret tlService5InsertList.Service5InsertList; return &ret }, func() meta.Function { var ret tlService5InsertList.Service5InsertList; return &ret }, nil) meta.SetGlobalFactoryCreateForObjectBytes(0xff8f7db9, func() meta.Object { var ret cycle_98d4570147919cfd6f6ebfc47c3e10a0.Service5LongEmptyOutput return &ret diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go index 4551b75e..b3ec9c8b 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall1/call1.go @@ -63,10 +63,6 @@ func (item *Call1) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call1) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call1) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go index 6d6c0669..bb687693 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall2/call2.go @@ -63,10 +63,6 @@ func (item *Call2) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call2) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call2) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go index b36e3660..c5521b71 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall3/call3.go @@ -63,10 +63,6 @@ func (item *Call3) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call3) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call3) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go index 0baf7c13..7d8bb079 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall4/call4.go @@ -63,10 +63,6 @@ func (item *Call4) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call4) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call4) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go index cdadad8c..c2fbca9a 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall5/call5.go @@ -63,10 +63,6 @@ func (item *Call5) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call5) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call5) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go index 22cf821d..f8ba82fe 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall6/call6.go @@ -63,10 +63,6 @@ func (item *Call6) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call6) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call6) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go index 059a825a..f2f0653a 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall7/call7.go @@ -63,10 +63,6 @@ func (item *Call7) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call7) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call7) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go index e8d9da38..5bc5fad2 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall8/call8.go @@ -63,10 +63,6 @@ func (item *Call8) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call8) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call8) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go index 2fe9696a..e8aa7fae 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlCall9/call9.go @@ -63,10 +63,6 @@ func (item *Call9) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call9) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call9) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go index 2f9b2f1e..c7ada15a 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1/ab.call1.go @@ -63,10 +63,6 @@ func (item *AbCall1) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall1) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall1) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go index 72328666..ac4a65c6 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2/ab.call2.go @@ -63,10 +63,6 @@ func (item *AbCall2) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall2) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall2) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go index ace4e027..e6d31d3e 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3/ab.call3.go @@ -63,10 +63,6 @@ func (item *AbCall3) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall3) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall3) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go index 3eca1318..8ac8aa48 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4/ab.call4.go @@ -63,10 +63,6 @@ func (item *AbCall4) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall4) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall4) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go index 41906de6..c30fc33d 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall5/ab.call5.go @@ -63,10 +63,6 @@ func (item *AbCall5) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall5) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall5) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go index 2c80c437..3cd8333c 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall6/ab.call6.go @@ -63,10 +63,6 @@ func (item *AbCall6) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall6) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall6) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go index 0443623e..6ba5d2b9 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall7/ab.call7.go @@ -63,10 +63,6 @@ func (item *AbCall7) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall7) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall7) ReadResult(w []byte, ret *tlAbTypeB.AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go index a202b0ef..273a91a4 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall8/ab.call8.go @@ -63,10 +63,6 @@ func (item *AbCall8) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall8) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall8) ReadResult(w []byte, ret *tlCdTypeB.CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go index ad669503..3de9cf0a 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall9/ab.call9.go @@ -63,10 +63,6 @@ func (item *AbCall9) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall9) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall9) ReadResult(w []byte, ret *tlTypeB.TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go index 1b4381ab..a0edbdea 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert/service5.insert.go @@ -80,10 +80,6 @@ func (item *Service5Insert) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Service5Insert) ContainsUnionTypesInResult() bool { - return true -} - func (item *Service5Insert) ReadResult(w []byte, ret *cycle_16847572a0831d4cd4c0c0fb513151f3.Service5Output) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go index 0389dbf8..d8a42aef 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5Long/tlService5LongInsert/service5Long.insert.go @@ -80,10 +80,6 @@ func (item *Service5LongInsert) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Service5LongInsert) ContainsUnionTypesInResult() bool { - return true -} - func (item *Service5LongInsert) ReadResult(w []byte, ret *cycle_98d4570147919cfd6f6ebfc47c3e10a0.Service5LongOutput) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go index d1736b81..a149b206 100644 --- a/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlusefulService/tlUsefulServiceGetUserEntity/usefulService.getUserEntity.go @@ -97,10 +97,6 @@ func (item *UsefulServiceGetUserEntity) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *UsefulServiceGetUserEntity) ContainsUnionTypesInResult() bool { - return false -} - func (item *UsefulServiceGetUserEntity) ReadResult(w []byte, ret *tlUsefulServiceGetUserEntityResultBoxedMaybe.UsefulServiceGetUserEntityResultBoxedMaybe) (_ []byte, err error) { return ret.ReadBoxed(w, item.FieldsMask) } diff --git a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go index ce068287..05aa2618 100644 --- a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go @@ -149,7 +149,7 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -388,6 +388,7 @@ func init() { fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false}) fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false}) fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true}) + fillFunction("service5.insertList#7cf362bc", "#7cf362bc", &TLItem{tag: 0x7cf362bc, annotations: 0x2, tlName: "service5.insertList", resultTypeContainsUnionTypes: true}) fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false}) fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true}) fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false}) diff --git a/internal/tlcodegen/test/gen/goldmaster/tl/tl.go b/internal/tlcodegen/test/gen/goldmaster/tl/tl.go index ec8c5a33..f5550a5d 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tl/tl.go +++ b/internal/tlcodegen/test/gen/goldmaster/tl/tl.go @@ -48,6 +48,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlInt64" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlIntBoxedMaybe" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlIntMaybe" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlListService5Output" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlLong" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlMaybeTest1" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlMaybeWrapperInt3" @@ -170,6 +171,7 @@ type ( Int64 = tlInt64.Int64 IntBoxedMaybe = tlIntBoxedMaybe.IntBoxedMaybe IntMaybe = tlIntMaybe.IntMaybe + ListService5Output = tlListService5Output.ListService5Output Long = tlLong.Long MaybeTest1 = tlMaybeTest1.MaybeTest1 MaybeWrapperInt3 = tlMaybeWrapperInt3.MaybeWrapperInt3 diff --git a/internal/tlcodegen/test/gen/goldmaster/tljson.html b/internal/tlcodegen/test/gen/goldmaster/tljson.html index 4947b156..c4bebf71 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tljson.html +++ b/internal/tlcodegen/test/gen/goldmaster/tljson.html @@ -111,6 +111,11 @@

Functions

service5.insertservice5.Output +
  • + + service5.insertList + → List<service5.Output> +
  • service5Long.insert @@ -2399,6 +2404,47 @@

    Maybe<int>

    +

    list<service5.Output>

    + //---- test recursive struct without union as result
    + +

    +
    +
    JSON
    +
    + { + + + + + + + + + + + + + + + + + + + +
      "flag": <uint32>, +
      "head": service5.Output,// flag bit #0 + +
      "tail": list<service5.Output>// flag bit #0 + +
    + } +
    +
    TL
    +
    + list#02d80cdd {X:Type} flag:# head:flag.0?X tail:flag.0?(list X) = List X; +
    +
    +

    maybeTest1

    @@ -4092,6 +4138,39 @@

    service5.insert

    +

    service5.insertList

    + +

    + Returns List<service5.Output> +
    +
    JSON
    +
    + { + + + + + + + + + + + + + +
      "flags": <uint32>, +
      "persistent": true// flags bit #0 + +
    + } +
    +
    TL
    +
    + readwrite service5.insertList#7cf362bc flags:# persistent:flags.0?%True = (List service5.Output); +
    +
    +

    service5Long.insert

    diff --git a/internal/tlcodegen/test/gen/goldmaster/tlservice5/tlservice5.go b/internal/tlcodegen/test/gen/goldmaster/tlservice5/tlservice5.go index 75b7f2e4..63e266f2 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tlservice5/tlservice5.go +++ b/internal/tlcodegen/test/gen/goldmaster/tlservice5/tlservice5.go @@ -10,11 +10,13 @@ package tlservice5 import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/cycle_16847572a0831d4cd4c0c0fb513151f3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5Insert" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList" ) type ( EmptyOutput = cycle_16847572a0831d4cd4c0c0fb513151f3.Service5EmptyOutput Insert = tlService5Insert.Service5Insert + InsertList = tlService5InsertList.Service5InsertList Output = cycle_16847572a0831d4cd4c0c0fb513151f3.Service5Output StringOutput = cycle_16847572a0831d4cd4c0c0fb513151f3.Service5StringOutput ) diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go index 304a10ae..59a5325f 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call1.go @@ -59,10 +59,6 @@ func (item *AbCall1) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall1) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall1) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go index 6311ddd9..3a948fbd 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call2.go @@ -59,10 +59,6 @@ func (item *AbCall2) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall2) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall2) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go index a8aab157..7d1e02a0 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call3.go @@ -59,10 +59,6 @@ func (item *AbCall3) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall3) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall3) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go index af5bae88..8eb0582a 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call4.go @@ -59,10 +59,6 @@ func (item *AbCall4) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall4) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall4) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go index 2547d276..a8be54d3 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call5.go @@ -59,10 +59,6 @@ func (item *AbCall5) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall5) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall5) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go index 32e5c712..9851206c 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call6.go @@ -59,10 +59,6 @@ func (item *AbCall6) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall6) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall6) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go index dd72345f..863b1b63 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call7.go @@ -59,10 +59,6 @@ func (item *AbCall7) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall7) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall7) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go index 61a7e7e0..ab3525e0 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call8.go @@ -59,10 +59,6 @@ func (item *AbCall8) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall8) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall8) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go index 02bb2e88..7fcaf0ed 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call9.go @@ -59,10 +59,6 @@ func (item *AbCall9) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *AbCall9) ContainsUnionTypesInResult() bool { - return false -} - func (item *AbCall9) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go index a8d32bec..18982fde 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call1.go @@ -59,10 +59,6 @@ func (item *Call1) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call1) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call1) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go index 245d63d2..0b0bbbac 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call2.go @@ -59,10 +59,6 @@ func (item *Call2) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call2) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call2) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go index 09a058f8..ab623e84 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call3.go @@ -59,10 +59,6 @@ func (item *Call3) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call3) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call3) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go index 8da6f156..81b5fdd5 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call4.go @@ -59,10 +59,6 @@ func (item *Call4) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call4) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call4) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go index 94c46554..759bd1f3 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call5.go @@ -59,10 +59,6 @@ func (item *Call5) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call5) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call5) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go index 0e7c0e34..7447b6c4 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call6.go @@ -59,10 +59,6 @@ func (item *Call6) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call6) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call6) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go index bdbb0b34..4da80c44 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call7.go @@ -59,10 +59,6 @@ func (item *Call7) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call7) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call7) ReadResult(w []byte, ret *AbTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go index 3e230ea5..eadc7fd0 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call8.go @@ -59,10 +59,6 @@ func (item *Call8) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call8) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call8) ReadResult(w []byte, ret *CdTypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go index 91984d7b..06f107aa 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/call9.go @@ -59,10 +59,6 @@ func (item *Call9) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Call9) ContainsUnionTypesInResult() bool { - return false -} - func (item *Call9) ReadResult(w []byte, ret *TypeB) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go index 785e5a95..e042f5a3 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insert.go @@ -77,10 +77,6 @@ func (item *Service5Insert) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Service5Insert) ContainsUnionTypesInResult() bool { - return true -} - func (item *Service5Insert) ReadResult(w []byte, ret *Service5Output) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go index 74a5aafb..10b4af47 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5Long.insert.go @@ -77,10 +77,6 @@ func (item *Service5LongInsert) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *Service5LongInsert) ContainsUnionTypesInResult() bool { - return true -} - func (item *Service5LongInsert) ReadResult(w []byte, ret *Service5LongOutput) (_ []byte, err error) { return ret.ReadBoxed(w) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go index d2a5149f..2161037c 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/usefulService.getUserEntity.go @@ -94,10 +94,6 @@ func (item *UsefulServiceGetUserEntity) WriteBoxed(w []byte) []byte { return item.Write(w) } -func (item *UsefulServiceGetUserEntity) ContainsUnionTypesInResult() bool { - return false -} - func (item *UsefulServiceGetUserEntity) ReadResult(w []byte, ret *UsefulServiceGetUserEntityResultBoxedMaybe) (_ []byte, err error) { return ret.ReadBoxed(w, item.FieldsMask) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go index d1a0d028..52d2cdab 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go @@ -149,7 +149,7 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasResultTypeContainUnionTypes() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -387,9 +387,9 @@ func init() { fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false}) fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false}) fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false}) - fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true}) + fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: false}) fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false}) - fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true}) + fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: false}) fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false}) fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false}) fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) From 3f45129b7796be5a827b822592da15329d57b9c2 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 11:06:19 +0300 Subject: [PATCH 10/16] forgot to push new files --- .../internal/tl/tlListService5Output/list.go | 264 ++++++++++++++++++ .../service5.insertList.go | 228 +++++++++++++++ 2 files changed, 492 insertions(+) create mode 100644 internal/tlcodegen/test/gen/goldmaster/internal/tl/tlListService5Output/list.go create mode 100644 internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList/service5.insertList.go diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlListService5Output/list.go b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlListService5Output/list.go new file mode 100644 index 00000000..4d3f1360 --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlListService5Output/list.go @@ -0,0 +1,264 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package tlListService5Output + +import ( + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/cycle_16847572a0831d4cd4c0c0fb513151f3" + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite +var _ = internal.ErrorInvalidEnumTag + +type ListService5Output struct { + Flag uint32 + Head cycle_16847572a0831d4cd4c0c0fb513151f3.Service5Output // Conditional: item.Flag.0 + Tail *ListService5Output // Conditional: item.Flag.0 +} + +func (ListService5Output) TLName() string { return "list" } +func (ListService5Output) TLTag() uint32 { return 0x02d80cdd } + +func (item *ListService5Output) SetHead(v cycle_16847572a0831d4cd4c0c0fb513151f3.Service5Output) { + item.Head = v + item.Flag |= 1 << 0 +} +func (item *ListService5Output) ClearHead() { + item.Head.Reset() + item.Flag &^= 1 << 0 +} +func (item ListService5Output) IsSetHead() bool { return item.Flag&(1<<0) != 0 } + +func (item *ListService5Output) SetTail(v ListService5Output) { + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + *item.Tail = v + item.Flag |= 1 << 0 +} +func (item *ListService5Output) ClearTail() { + if item.Tail != nil { + item.Tail.Reset() + } + item.Flag &^= 1 << 0 +} +func (item ListService5Output) IsSetTail() bool { return item.Flag&(1<<0) != 0 } + +func (item *ListService5Output) Reset() { + item.Flag = 0 + item.Head.Reset() + if item.Tail != nil { + item.Tail.Reset() + } +} + +func (item *ListService5Output) FillRandom(rg *basictl.RandGenerator) { + var maskFlag uint32 + maskFlag = basictl.RandomUint(rg) + item.Flag = 0 + if maskFlag&(1<<0) != 0 { + item.Flag |= (1 << 0) + } + if item.Flag&(1<<0) != 0 { + item.Head.FillRandom(rg) + } else { + item.Head.Reset() + } + if item.Flag&(1<<0) != 0 { + rg.IncreaseDepth() + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + item.Tail.FillRandom(rg) + rg.DecreaseDepth() + } else { + if item.Tail != nil { + item.Tail.Reset() + } + } +} + +func (item *ListService5Output) Read(w []byte) (_ []byte, err error) { + if w, err = basictl.NatRead(w, &item.Flag); err != nil { + return w, err + } + if item.Flag&(1<<0) != 0 { + if w, err = item.Head.ReadBoxed(w); err != nil { + return w, err + } + } else { + item.Head.Reset() + } + if item.Flag&(1<<0) != 0 { + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + if w, err = item.Tail.Read(w); err != nil { + return w, err + } + } else { + if item.Tail != nil { + item.Tail.Reset() + } + } + return w, nil +} + +// This method is general version of Write, use it instead! +func (item *ListService5Output) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *ListService5Output) Write(w []byte) []byte { + w = basictl.NatWrite(w, item.Flag) + if item.Flag&(1<<0) != 0 { + w = item.Head.WriteBoxed(w) + } + if item.Flag&(1<<0) != 0 { + w = item.Tail.Write(w) + } + return w +} + +func (item *ListService5Output) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0x02d80cdd); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *ListService5Output) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *ListService5Output) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0x02d80cdd) + return item.Write(w) +} + +func (item ListService5Output) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *ListService5Output) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + var propFlagPresented bool + var propHeadPresented bool + var propTailPresented bool + + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + key := in.UnsafeFieldName(true) + in.WantColon() + switch key { + case "flag": + if propFlagPresented { + return internal.ErrorInvalidJSONWithDuplicatingKeys("list", "flag") + } + if err := internal.Json2ReadUint32(in, &item.Flag); err != nil { + return err + } + propFlagPresented = true + case "head": + if propHeadPresented { + return internal.ErrorInvalidJSONWithDuplicatingKeys("list", "head") + } + if err := item.Head.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + propHeadPresented = true + case "tail": + if propTailPresented { + return internal.ErrorInvalidJSONWithDuplicatingKeys("list", "tail") + } + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + if err := item.Tail.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + propTailPresented = true + default: + return internal.ErrorInvalidJSONExcessElement("list", key) + } + in.WantComma() + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + if !propFlagPresented { + item.Flag = 0 + } + if !propHeadPresented { + item.Head.Reset() + } + if !propTailPresented { + if item.Tail != nil { + item.Tail.Reset() + } + } + if propHeadPresented { + item.Flag |= 1 << 0 + } + if propTailPresented { + item.Flag |= 1 << 0 + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *ListService5Output) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *ListService5Output) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *ListService5Output) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + backupIndexFlag := len(w) + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"flag":`...) + w = basictl.JSONWriteUint32(w, item.Flag) + if (item.Flag != 0) == false { + w = w[:backupIndexFlag] + } + if item.Flag&(1<<0) != 0 { + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"head":`...) + w = item.Head.WriteJSONOpt(newTypeNames, short, w) + } + if item.Flag&(1<<0) != 0 { + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"tail":`...) + w = item.Tail.WriteJSONOpt(newTypeNames, short, w) + } + return append(w, '}') +} + +func (item *ListService5Output) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *ListService5Output) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return internal.ErrorInvalidJSON("list", err.Error()) + } + return nil +} diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList/service5.insertList.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList/service5.insertList.go new file mode 100644 index 00000000..da041a69 --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlservice5/tlService5InsertList/service5.insertList.go @@ -0,0 +1,228 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package tlService5InsertList + +import ( + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlListService5Output" + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite +var _ = internal.ErrorInvalidEnumTag + +type Service5InsertList struct { + Flags uint32 + // Persistent (TrueType) // Conditional: item.Flags.0 +} + +func (Service5InsertList) TLName() string { return "service5.insertList" } +func (Service5InsertList) TLTag() uint32 { return 0x7cf362bc } + +func (item *Service5InsertList) SetPersistent(v bool) { + if v { + item.Flags |= 1 << 0 + } else { + item.Flags &^= 1 << 0 + } +} +func (item Service5InsertList) IsSetPersistent() bool { return item.Flags&(1<<0) != 0 } + +func (item *Service5InsertList) Reset() { + item.Flags = 0 +} + +func (item *Service5InsertList) FillRandom(rg *basictl.RandGenerator) { + var maskFlags uint32 + maskFlags = basictl.RandomUint(rg) + item.Flags = 0 + if maskFlags&(1<<0) != 0 { + item.Flags |= (1 << 0) + } +} + +func (item *Service5InsertList) Read(w []byte) (_ []byte, err error) { + if w, err = basictl.NatRead(w, &item.Flags); err != nil { + return w, err + } + return w, nil +} + +// This method is general version of Write, use it instead! +func (item *Service5InsertList) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *Service5InsertList) Write(w []byte) []byte { + w = basictl.NatWrite(w, item.Flags) + return w +} + +func (item *Service5InsertList) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0x7cf362bc); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *Service5InsertList) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *Service5InsertList) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0x7cf362bc) + return item.Write(w) +} + +func (item *Service5InsertList) ReadResult(w []byte, ret *tlListService5Output.ListService5Output) (_ []byte, err error) { + return ret.ReadBoxed(w) +} + +func (item *Service5InsertList) WriteResult(w []byte, ret tlListService5Output.ListService5Output) (_ []byte, err error) { + w = ret.WriteBoxed(w) + return w, nil +} + +func (item *Service5InsertList) ReadResultJSON(legacyTypeNames bool, in *basictl.JsonLexer, ret *tlListService5Output.ListService5Output) error { + if err := ret.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + return nil +} + +func (item *Service5InsertList) WriteResultJSON(w []byte, ret tlListService5Output.ListService5Output) (_ []byte, err error) { + return item.writeResultJSON(true, false, w, ret) +} + +func (item *Service5InsertList) writeResultJSON(newTypeNames bool, short bool, w []byte, ret tlListService5Output.ListService5Output) (_ []byte, err error) { + w = ret.WriteJSONOpt(newTypeNames, short, w) + return w, nil +} + +func (item *Service5InsertList) ReadResultWriteResultJSON(r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret tlListService5Output.ListService5Output + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.WriteResultJSON(w, ret) + return r, w, err +} + +func (item *Service5InsertList) ReadResultWriteResultJSONOpt(newTypeNames bool, short bool, r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret tlListService5Output.ListService5Output + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.writeResultJSON(newTypeNames, short, w, ret) + return r, w, err +} + +func (item *Service5InsertList) ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) { + var ret tlListService5Output.ListService5Output + err := item.ReadResultJSON(true, &basictl.JsonLexer{Data: r}, &ret) + if err != nil { + return r, w, err + } + w, err = item.WriteResult(w, ret) + return r, w, err +} + +func (item Service5InsertList) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *Service5InsertList) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + var propFlagsPresented bool + var trueTypePersistentPresented bool + var trueTypePersistentValue bool + + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + key := in.UnsafeFieldName(true) + in.WantColon() + switch key { + case "flags": + if propFlagsPresented { + return internal.ErrorInvalidJSONWithDuplicatingKeys("service5.insertList", "flags") + } + if err := internal.Json2ReadUint32(in, &item.Flags); err != nil { + return err + } + propFlagsPresented = true + case "persistent": + if trueTypePersistentPresented { + return internal.ErrorInvalidJSONWithDuplicatingKeys("service5.insertList", "persistent") + } + if err := internal.Json2ReadBool(in, &trueTypePersistentValue); err != nil { + return err + } + trueTypePersistentPresented = true + default: + return internal.ErrorInvalidJSONExcessElement("service5.insertList", key) + } + in.WantComma() + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + if !propFlagsPresented { + item.Flags = 0 + } + if trueTypePersistentPresented { + if trueTypePersistentValue { + item.Flags |= 1 << 0 + } + } + // tries to set bit to zero if it is 1 + if trueTypePersistentPresented && !trueTypePersistentValue && (item.Flags&(1<<0) != 0) { + return internal.ErrorInvalidJSON("service5.insertList", "fieldmask bit flags.0 is indefinite because of the contradictions in values") + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *Service5InsertList) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *Service5InsertList) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *Service5InsertList) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + backupIndexFlags := len(w) + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"flags":`...) + w = basictl.JSONWriteUint32(w, item.Flags) + if (item.Flags != 0) == false { + w = w[:backupIndexFlags] + } + if item.Flags&(1<<0) != 0 { + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"persistent":true`...) + } + return append(w, '}') +} + +func (item *Service5InsertList) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *Service5InsertList) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return internal.ErrorInvalidJSON("service5.insertList", err.Error()) + } + return nil +} From 3e0d43460eca0cf3e616071ff741620ac7559c45 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 11:31:07 +0300 Subject: [PATCH 11/16] add test for invariant --- .../goldmaster_invariants_test.go | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go diff --git a/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go b/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go new file mode 100644 index 00000000..81cf56d4 --- /dev/null +++ b/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go @@ -0,0 +1,24 @@ +package codegen + +import ( + "github.com/stretchr/testify/assert" + "testing" +) +import "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/meta" + +func TestFunctionHasUnion(t *testing.T) { + { + fun := meta.FactoryItemByTLName("service5.insertList") + if assert.NotNil(t, fun) { + assert.True(t, fun.IsFunction()) + assert.True(t, fun.HasUnionTypesInResult()) + } + } + { + fun := meta.FactoryItemByTLName("usefulService.getUserEntity") + if assert.NotNil(t, fun) { + assert.True(t, fun.IsFunction()) + assert.True(t, !fun.HasUnionTypesInResult()) + } + } +} From 7da481e9496ae98059e028e72ad75aeb18a983ea Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 13:54:58 +0300 Subject: [PATCH 12/16] add enum test for invariant --- .../goldmaster_invariants_test.go | 10 ++++++++++ .../gen/goldmaster/constants/constants.go | 1 + .../test/gen/goldmaster/factory/factory.go | 2 ++ .../goldmaster/factory_bytes/factory_bytes.go | 2 ++ .../test/gen/goldmaster/meta/meta.go | 1 + .../test/gen/goldmaster/tlab/tlab.go | 2 ++ .../tlcodegen/test/gen/goldmaster/tljson.html | 20 +++++++++++++++++++ internal/tlcodegen/test/tls/goldmaster.tl | 1 + .../test/tls/goldmaster_canonical.tl | 1 + 9 files changed, 40 insertions(+) diff --git a/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go b/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go index 81cf56d4..3e630ef0 100644 --- a/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go +++ b/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go @@ -8,6 +8,7 @@ import "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/meta" func TestFunctionHasUnion(t *testing.T) { { + // test type which contains union in its recursive definition fun := meta.FactoryItemByTLName("service5.insertList") if assert.NotNil(t, fun) { assert.True(t, fun.IsFunction()) @@ -15,10 +16,19 @@ func TestFunctionHasUnion(t *testing.T) { } } { + // test type which doesn't contain union in its recursive definition fun := meta.FactoryItemByTLName("usefulService.getUserEntity") if assert.NotNil(t, fun) { assert.True(t, fun.IsFunction()) assert.True(t, !fun.HasUnionTypesInResult()) } } + { + // test type which contains enum in its recursive definition + fun := meta.FactoryItemByTLName("ab.call10") + if assert.NotNil(t, fun) { + assert.True(t, fun.IsFunction()) + assert.True(t, fun.HasUnionTypesInResult()) + } + } } diff --git a/internal/tlcodegen/test/gen/goldmaster/constants/constants.go b/internal/tlcodegen/test/gen/goldmaster/constants/constants.go index 7bc0e677..86b0ca1b 100644 --- a/internal/tlcodegen/test/gen/goldmaster/constants/constants.go +++ b/internal/tlcodegen/test/gen/goldmaster/constants/constants.go @@ -21,6 +21,7 @@ const ( Aaa = 0x05b0e500 // aaa AbAlias = 0x944aaa97 // ab.alias AbCall1 = 0x20c5fb2d // ab.call1 + AbCall10 = 0x8db2a4f8 // ab.call10 AbCall2 = 0x77d5f057 // ab.call2 AbCall3 = 0x0a083445 // ab.call3 AbCall4 = 0xc1220a1e // ab.call4 diff --git a/internal/tlcodegen/test/gen/goldmaster/factory/factory.go b/internal/tlcodegen/test/gen/goldmaster/factory/factory.go index 04a11d8f..f5cef616 100644 --- a/internal/tlcodegen/test/gen/goldmaster/factory/factory.go +++ b/internal/tlcodegen/test/gen/goldmaster/factory/factory.go @@ -67,6 +67,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlUseTrue" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tla/tlATop2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4" @@ -126,6 +127,7 @@ func init() { meta.SetGlobalFactoryCreateForObject(0xa7662843, func() meta.Object { var ret cycle_463e8ce0a74f5ec3e904ecdc85b1b857.AUNionA; return &ret }) meta.SetGlobalFactoryCreateForObject(0x944aaa97, func() meta.Object { var ret cycle_b62dd5050d0a18c7485fd980c087f32c.AbAlias; return &ret }) meta.SetGlobalFactoryCreateForFunction(0x20c5fb2d, func() meta.Object { var ret tlAbCall1.AbCall1; return &ret }, func() meta.Function { var ret tlAbCall1.AbCall1; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunction(0x8db2a4f8, func() meta.Object { var ret tlAbCall10.AbCall10; return &ret }, func() meta.Function { var ret tlAbCall10.AbCall10; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x77d5f057, func() meta.Object { var ret tlAbCall2.AbCall2; return &ret }, func() meta.Function { var ret tlAbCall2.AbCall2; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x0a083445, func() meta.Object { var ret tlAbCall3.AbCall3; return &ret }, func() meta.Function { var ret tlAbCall3.AbCall3; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0xc1220a1e, func() meta.Object { var ret tlAbCall4.AbCall4; return &ret }, func() meta.Function { var ret tlAbCall4.AbCall4; return &ret }, nil) diff --git a/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go b/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go index 1af8918b..4e158857 100644 --- a/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go +++ b/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go @@ -67,6 +67,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlUseTrue" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tla/tlATop2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4" @@ -126,6 +127,7 @@ func init() { meta.SetGlobalFactoryCreateForObjectBytes(0xa7662843, func() meta.Object { var ret cycle_463e8ce0a74f5ec3e904ecdc85b1b857.AUNionA; return &ret }) meta.SetGlobalFactoryCreateForObjectBytes(0x944aaa97, func() meta.Object { var ret cycle_b62dd5050d0a18c7485fd980c087f32c.AbAlias; return &ret }) meta.SetGlobalFactoryCreateForFunctionBytes(0x20c5fb2d, func() meta.Object { var ret tlAbCall1.AbCall1; return &ret }, func() meta.Function { var ret tlAbCall1.AbCall1; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunctionBytes(0x8db2a4f8, func() meta.Object { var ret tlAbCall10.AbCall10; return &ret }, func() meta.Function { var ret tlAbCall10.AbCall10; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x77d5f057, func() meta.Object { var ret tlAbCall2.AbCall2; return &ret }, func() meta.Function { var ret tlAbCall2.AbCall2; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x0a083445, func() meta.Object { var ret tlAbCall3.AbCall3; return &ret }, func() meta.Function { var ret tlAbCall3.AbCall3; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0xc1220a1e, func() meta.Object { var ret tlAbCall4.AbCall4; return &ret }, func() meta.Function { var ret tlAbCall4.AbCall4; return &ret }, nil) diff --git a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go index 05aa2618..dcae79d4 100644 --- a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go @@ -311,6 +311,7 @@ func init() { fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false}) fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false}) fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false}) + fillFunction("ab.call10#8db2a4f8", "#8db2a4f8", &TLItem{tag: 0x8db2a4f8, annotations: 0x1, tlName: "ab.call10", resultTypeContainsUnionTypes: true}) fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false}) fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false}) fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false}) diff --git a/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go b/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go index 4b80f46a..434599e5 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go +++ b/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go @@ -13,6 +13,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlAbMyTypeBoxedMaybe" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlAbMyTypeMaybe" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4" @@ -36,6 +37,7 @@ import ( type ( Alias = cycle_b62dd5050d0a18c7485fd980c087f32c.AbAlias Call1 = tlAbCall1.AbCall1 + Call10 = tlAbCall10.AbCall10 Call2 = tlAbCall2.AbCall2 Call3 = tlAbCall3.AbCall3 Call4 = tlAbCall4.AbCall4 diff --git a/internal/tlcodegen/test/gen/goldmaster/tljson.html b/internal/tlcodegen/test/gen/goldmaster/tljson.html index c4bebf71..d80fde58 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tljson.html +++ b/internal/tlcodegen/test/gen/goldmaster/tljson.html @@ -21,6 +21,11 @@

    Functions

    ab.call1ab.TypeB
  • +
  • + + ab.call10 + → a.Color +
  • ab.call2 @@ -416,6 +421,21 @@

    ab.call1

    +

    ab.call10

    + +

    + Returns a.Color +
    +
    JSON
    +
    + {} +
    +
    TL
    +
    + read ab.call10#8db2a4f8 = a.Color; +
    +
    +

    ab.call2

    diff --git a/internal/tlcodegen/test/tls/goldmaster.tl b/internal/tlcodegen/test/tls/goldmaster.tl index 503e55d9..3b47ada4 100644 --- a/internal/tlcodegen/test/tls/goldmaster.tl +++ b/internal/tlcodegen/test/tls/goldmaster.tl @@ -263,5 +263,6 @@ service5Long.stringOutput#dc170ff5 http_code:long response:string = service5Long @read ab.call7 x:typeA => ab.TypeB; @read ab.call8 x:typeA => cd.TypeB; @read ab.call9 x:typeA => TypeB; +@read ab.call10 => a.Color; // @write logs2.addIndex type_id:int field:%String => Bool; // Test that %String is canonically resolved into primitive string diff --git a/internal/tlcodegen/test/tls/goldmaster_canonical.tl b/internal/tlcodegen/test/tls/goldmaster_canonical.tl index 498b6b98..374d679b 100644 --- a/internal/tlcodegen/test/tls/goldmaster_canonical.tl +++ b/internal/tlcodegen/test/tls/goldmaster_canonical.tl @@ -124,6 +124,7 @@ service5Long.stringOutput#dc170ff5 http_code:long response:string = service5Long @read ab.call7#46ec10bf x:typeA = ab.TypeB // ./internal/tlcodegen/test/tls/goldmaster.tl @read ab.call8#1b8652d9 x:typeA = cd.TypeB // ./internal/tlcodegen/test/tls/goldmaster.tl @read ab.call9#75de906c x:typeA = TypeB // ./internal/tlcodegen/test/tls/goldmaster.tl +@read ab.call10#8db2a4f8 = a.Color // ./internal/tlcodegen/test/tls/goldmaster.tl @read call1#a7302fbc x:ab.typeA = ab.TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl @read call2#f02024c6 x:ab.typeA = cd.TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl @read call3#6ace6718 x:ab.typeA = TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl From c80953eb855b33a664a75fe9bdae1472b87965cd Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 13:56:20 +0300 Subject: [PATCH 13/16] forgot again --- .../internal/tlab/tlAbCall10/ab.call10.go | 153 ++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10/ab.call10.go diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10/ab.call10.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10/ab.call10.go new file mode 100644 index 00000000..a3159316 --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10/ab.call10.go @@ -0,0 +1,153 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package tlAbCall10 + +import ( + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tla/tlAColor" + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite +var _ = internal.ErrorInvalidEnumTag + +type AbCall10 struct { +} + +func (AbCall10) TLName() string { return "ab.call10" } +func (AbCall10) TLTag() uint32 { return 0x8db2a4f8 } + +func (item *AbCall10) Reset() {} + +func (item *AbCall10) FillRandom(rg *basictl.RandGenerator) {} + +func (item *AbCall10) Read(w []byte) (_ []byte, err error) { return w, nil } + +// This method is general version of Write, use it instead! +func (item *AbCall10) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *AbCall10) Write(w []byte) []byte { + return w +} + +func (item *AbCall10) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0x8db2a4f8); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *AbCall10) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *AbCall10) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0x8db2a4f8) + return item.Write(w) +} + +func (item *AbCall10) ReadResult(w []byte, ret *tlAColor.AColor) (_ []byte, err error) { + return ret.ReadBoxed(w) +} + +func (item *AbCall10) WriteResult(w []byte, ret tlAColor.AColor) (_ []byte, err error) { + w = ret.WriteBoxed(w) + return w, nil +} + +func (item *AbCall10) ReadResultJSON(legacyTypeNames bool, in *basictl.JsonLexer, ret *tlAColor.AColor) error { + if err := ret.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + return nil +} + +func (item *AbCall10) WriteResultJSON(w []byte, ret tlAColor.AColor) (_ []byte, err error) { + return item.writeResultJSON(true, false, w, ret) +} + +func (item *AbCall10) writeResultJSON(newTypeNames bool, short bool, w []byte, ret tlAColor.AColor) (_ []byte, err error) { + w = ret.WriteJSONOpt(newTypeNames, short, w) + return w, nil +} + +func (item *AbCall10) ReadResultWriteResultJSON(r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret tlAColor.AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.WriteResultJSON(w, ret) + return r, w, err +} + +func (item *AbCall10) ReadResultWriteResultJSONOpt(newTypeNames bool, short bool, r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret tlAColor.AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.writeResultJSON(newTypeNames, short, w, ret) + return r, w, err +} + +func (item *AbCall10) ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) { + var ret tlAColor.AColor + err := item.ReadResultJSON(true, &basictl.JsonLexer{Data: r}, &ret) + if err != nil { + return r, w, err + } + w, err = item.WriteResult(w, ret) + return r, w, err +} + +func (item AbCall10) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *AbCall10) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + return internal.ErrorInvalidJSON("ab.call10", "this object can't have properties") + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *AbCall10) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *AbCall10) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *AbCall10) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + return append(w, '}') +} + +func (item *AbCall10) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *AbCall10) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return internal.ErrorInvalidJSON("ab.call10", err.Error()) + } + return nil +} From 523255d4b87da2c9679901da76db98a9af61bf69 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 15:49:15 +0300 Subject: [PATCH 14/16] add HasUnionTypesInArguments --- internal/tlcodegen/qt_meta.qtpl | 14 +++++++++++--- internal/tlcodegen/qt_meta.qtpl.go | 6 ++++++ internal/tlcodegen/type_rw.go | 8 ++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/internal/tlcodegen/qt_meta.qtpl b/internal/tlcodegen/qt_meta.qtpl index bf221fc0..94b0c29d 100644 --- a/internal/tlcodegen/qt_meta.qtpl +++ b/internal/tlcodegen/qt_meta.qtpl @@ -149,6 +149,7 @@ type TLItem struct { tlName string resultTypeContainsUnionTypes bool + argumentsTypesContainUnionTypes bool createFunction func() Function createFunctionLong func() Function @@ -166,6 +167,7 @@ func (item TLItem) IsFunction() bool { return item.createFunction != nil func (item TLItem) CreateFunction() Function { return item.createFunction() } func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInArguments() bool { return item.argumentsTypesContainUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -340,16 +342,22 @@ func init() { {%- if wr.tlTag == 0 || !wr.IsTopLevel() -%} {%- continue -%} {%- endif -%} {%- stripspace -%} {%- if fun, ok := wr.trw.(*TypeRWStruct); ok && len(wr.NatParams) == 0 -%} - {%- code resultTypeContainsUnionTypes := false -%} + {%- code + resultTypeContainsUnionTypes := false + argumentsTypesContainUnionTypes := false + -%} {%- if fun.ResultType != nil -%} - {%- code resultTypeContainsUnionTypes = fun.wr.DoesReturnTypeContainUnionTypes() -%} + {%- code + resultTypeContainsUnionTypes = fun.wr.DoesReturnTypeContainUnionTypes() + argumentsTypesContainUnionTypes = fun.wr.DoArgumentsContainUnionTypes() + -%} fillFunction( {%- else -%} fillObject( {%- endif -%} "{%= wr.tlName.String() %}#{%s= fmt.Sprintf("%08x", wr.tlTag) %}", {%q= fmt.Sprintf("#%08x", wr.tlTag) %}, - &TLItem{tag: {%s= fmt.Sprintf("0x%08x", wr.tlTag) %}, annotations: {%s= fmt.Sprintf("0x%x", wr.AnnotationsMask()) %}, tlName: "{%= wr.tlName.String() %}", resultTypeContainsUnionTypes: {%v= resultTypeContainsUnionTypes %}}) + &TLItem{tag: {%s= fmt.Sprintf("0x%08x", wr.tlTag) %}, annotations: {%s= fmt.Sprintf("0x%x", wr.AnnotationsMask()) %}, tlName: "{%= wr.tlName.String() %}", resultTypeContainsUnionTypes: {%v= resultTypeContainsUnionTypes %}, argumentsTypesContainUnionTypes: {%v= argumentsTypesContainUnionTypes %}}) {%- endif -%} {%- endstripspace -%} diff --git a/internal/tlcodegen/qt_meta.qtpl.go b/internal/tlcodegen/qt_meta.qtpl.go index 324caf3c..727753d9 100644 --- a/internal/tlcodegen/qt_meta.qtpl.go +++ b/internal/tlcodegen/qt_meta.qtpl.go @@ -188,6 +188,7 @@ type TLItem struct { tlName string resultTypeContainsUnionTypes bool + argumentsTypesContainUnionTypes bool createFunction func() Function createFunctionLong func() Function @@ -205,6 +206,7 @@ func (item TLItem) IsFunction() bool { return item.createFunction != nil func (item TLItem) CreateFunction() Function { return item.createFunction() } func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInArguments() bool { return item.argumentsTypesContainUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -391,9 +393,11 @@ func init() { } if fun, ok := wr.trw.(*TypeRWStruct); ok && len(wr.NatParams) == 0 { resultTypeContainsUnionTypes := false + argumentsTypesContainUnionTypes := false if fun.ResultType != nil { resultTypeContainsUnionTypes = fun.wr.DoesReturnTypeContainUnionTypes() + argumentsTypesContainUnionTypes = fun.wr.DoArgumentsContainUnionTypes() qw422016.N().S(`fillFunction(`) } else { @@ -413,6 +417,8 @@ func init() { wr.tlName.StreamString(qw422016) qw422016.N().S(`", resultTypeContainsUnionTypes:`) qw422016.N().V(resultTypeContainsUnionTypes) + qw422016.N().S(`, argumentsTypesContainUnionTypes:`) + qw422016.N().V(argumentsTypesContainUnionTypes) qw422016.N().S(`})`) } qw422016.N().S(` diff --git a/internal/tlcodegen/type_rw.go b/internal/tlcodegen/type_rw.go index 9249e22e..4373c7b0 100644 --- a/internal/tlcodegen/type_rw.go +++ b/internal/tlcodegen/type_rw.go @@ -165,6 +165,14 @@ func (w *TypeRWWrapper) AnnotationsMask() uint32 { return mask } +func (w *TypeRWWrapper) DoArgumentsContainUnionTypes() bool { + if w, ok := w.trw.(*TypeRWStruct); ok && w.ResultType != nil { + return w.wr.containsUnion(map[*TypeRWWrapper]bool{}) + } else { + return false + } +} + func (w *TypeRWWrapper) DoesReturnTypeContainUnionTypes() bool { if w, ok := w.trw.(*TypeRWStruct); ok && w.ResultType != nil { return w.ResultType.containsUnion(map[*TypeRWWrapper]bool{}) From c37f072761e3e49dc0b636f606152aaac5e9b6d3 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 15:49:37 +0300 Subject: [PATCH 15/16] add new function to test --- internal/tlcodegen/test/tls/goldmaster.tl | 1 + internal/tlcodegen/test/tls/goldmaster_canonical.tl | 1 + 2 files changed, 2 insertions(+) diff --git a/internal/tlcodegen/test/tls/goldmaster.tl b/internal/tlcodegen/test/tls/goldmaster.tl index 3b47ada4..8537e907 100644 --- a/internal/tlcodegen/test/tls/goldmaster.tl +++ b/internal/tlcodegen/test/tls/goldmaster.tl @@ -264,5 +264,6 @@ service5Long.stringOutput#dc170ff5 http_code:long response:string = service5Long @read ab.call8 x:typeA => cd.TypeB; @read ab.call9 x:typeA => TypeB; @read ab.call10 => a.Color; +@read ab.call11 x:a.Color => a.Color; // @write logs2.addIndex type_id:int field:%String => Bool; // Test that %String is canonically resolved into primitive string diff --git a/internal/tlcodegen/test/tls/goldmaster_canonical.tl b/internal/tlcodegen/test/tls/goldmaster_canonical.tl index 374d679b..1bd5d173 100644 --- a/internal/tlcodegen/test/tls/goldmaster_canonical.tl +++ b/internal/tlcodegen/test/tls/goldmaster_canonical.tl @@ -125,6 +125,7 @@ service5Long.stringOutput#dc170ff5 http_code:long response:string = service5Long @read ab.call8#1b8652d9 x:typeA = cd.TypeB // ./internal/tlcodegen/test/tls/goldmaster.tl @read ab.call9#75de906c x:typeA = TypeB // ./internal/tlcodegen/test/tls/goldmaster.tl @read ab.call10#8db2a4f8 = a.Color // ./internal/tlcodegen/test/tls/goldmaster.tl +@read ab.call11#ecb2a36c x:a.Color = a.Color // ./internal/tlcodegen/test/tls/goldmaster.tl @read call1#a7302fbc x:ab.typeA = ab.TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl @read call2#f02024c6 x:ab.typeA = cd.TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl @read call3#6ace6718 x:ab.typeA = TypeB // ./internal/tlcodegen/test/tls/goldmaster2.tl From 6f111365ae95f7dcac53b799bfdff56743d14535 Mon Sep 17 00:00:00 2001 From: Fedor Vikhnin Date: Tue, 29 Oct 2024 15:50:16 +0300 Subject: [PATCH 16/16] update goldmaster --- .../goldmaster_invariants_test.go | 19 ++ .../tlcodegen/test/gen/cases/meta/meta.go | 102 +++---- .../tlcodegen/test/gen/goldmaster.tlo.json | 223 ++++++++++++++- .../gen/goldmaster/constants/constants.go | 1 + .../test/gen/goldmaster/factory/factory.go | 2 + .../goldmaster/factory_bytes/factory_bytes.go | 2 + .../internal/tlab/tlAbCall11/ab.call11.go | 183 ++++++++++++ .../test/gen/goldmaster/meta/meta.go | 217 ++++++++------- .../test/gen/goldmaster/tlab/tlab.go | 2 + .../tlcodegen/test/gen/goldmaster/tljson.html | 30 ++ .../goldmaster_nosplit/constants/constants.go | 4 + .../gen/goldmaster_nosplit/factory/factory.go | 3 + .../factory_bytes/factory_bytes.go | 3 + .../goldmaster_nosplit/internal/ab.call10.go | 150 ++++++++++ .../goldmaster_nosplit/internal/ab.call11.go | 180 ++++++++++++ .../gen/goldmaster_nosplit/internal/list.go | 261 ++++++++++++++++++ .../internal/service5.insertList.go | 225 +++++++++++++++ .../test/gen/goldmaster_nosplit/meta/meta.go | 215 ++++++++------- .../test/gen/goldmaster_nosplit/tl/tl.go | 1 + .../test/gen/goldmaster_nosplit/tlab/tlab.go | 2 + .../test/gen/goldmaster_nosplit/tljson.html | 129 +++++++++ .../tlservice5/tlservice5.go | 1 + 22 files changed, 1690 insertions(+), 265 deletions(-) create mode 100644 internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11/ab.call11.go create mode 100644 internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call10.go create mode 100644 internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call11.go create mode 100644 internal/tlcodegen/test/gen/goldmaster_nosplit/internal/list.go create mode 100644 internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insertList.go diff --git a/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go b/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go index 3e630ef0..7cef8063 100644 --- a/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go +++ b/internal/tlcodegen/test/codegen_test/goldmaster_invariants_test.go @@ -32,3 +32,22 @@ func TestFunctionHasUnion(t *testing.T) { } } } + +func TestFunctionHasUnionInArguments(t *testing.T) { + { + // test type which contains union in its recursive definition + fun := meta.FactoryItemByTLName("service5.insertList") + if assert.NotNil(t, fun) { + assert.True(t, fun.IsFunction()) + assert.True(t, !fun.HasUnionTypesInArguments()) + } + } + { + // test type which doesn't contain union in its recursive definition + fun := meta.FactoryItemByTLName("ab.call11") + if assert.NotNil(t, fun) { + assert.True(t, fun.IsFunction()) + assert.True(t, fun.HasUnionTypesInArguments()) + } + } +} diff --git a/internal/tlcodegen/test/gen/cases/meta/meta.go b/internal/tlcodegen/test/gen/cases/meta/meta.go index d017ce5a..f132b926 100644 --- a/internal/tlcodegen/test/gen/cases/meta/meta.go +++ b/internal/tlcodegen/test/gen/cases/meta/meta.go @@ -131,7 +131,8 @@ type TLItem struct { annotations uint32 tlName string - resultTypeContainsUnionTypes bool + resultTypeContainsUnionTypes bool + argumentsTypesContainUnionTypes bool createFunction func() Function createFunctionLong func() Function @@ -147,7 +148,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInArguments() bool { return item.argumentsTypesContainUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -299,52 +301,52 @@ func fillFunction(n1 string, n2 string, item *TLItem) { } func init() { - fillObject("benchmarks.vruhash#d31bd0fd", "#d31bd0fd", &TLItem{tag: 0xd31bd0fd, annotations: 0x0, tlName: "benchmarks.vruhash", resultTypeContainsUnionTypes: false}) - fillObject("benchmarks.vruposition#32792c04", "#32792c04", &TLItem{tag: 0x32792c04, annotations: 0x0, tlName: "benchmarks.vruposition", resultTypeContainsUnionTypes: false}) - fillObject("benchmarks.vrutoyTopLevelContainer#fb442ca5", "#fb442ca5", &TLItem{tag: 0xfb442ca5, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainer", resultTypeContainsUnionTypes: false}) - fillObject("benchmarks.vrutoyTopLevelContainerWithDependency#c176008e", "#c176008e", &TLItem{tag: 0xc176008e, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainerWithDependency", resultTypeContainsUnionTypes: false}) - fillObject("benchmarks.vrutoytopLevelUnionBig#ef556bee", "#ef556bee", &TLItem{tag: 0xef556bee, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionBig", resultTypeContainsUnionTypes: false}) - fillObject("benchmarks.vrutoytopLevelUnionEmpty#ce27c770", "#ce27c770", &TLItem{tag: 0xce27c770, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionEmpty", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testArray#3762fb81", "#3762fb81", &TLItem{tag: 0x3762fb81, annotations: 0x0, tlName: "cases_bytes.testArray", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testDictAny#5a5fce57", "#5a5fce57", &TLItem{tag: 0x5a5fce57, annotations: 0x0, tlName: "cases_bytes.testDictAny", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testDictInt#453ace07", "#453ace07", &TLItem{tag: 0x453ace07, annotations: 0x0, tlName: "cases_bytes.testDictInt", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testDictString#6c04d6ce", "#6c04d6ce", &TLItem{tag: 0x6c04d6ce, annotations: 0x0, tlName: "cases_bytes.testDictString", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testDictStringString#ad69c772", "#ad69c772", &TLItem{tag: 0xad69c772, annotations: 0x0, tlName: "cases_bytes.testDictStringString", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testEnum1#58aad3f5", "#58aad3f5", &TLItem{tag: 0x58aad3f5, annotations: 0x0, tlName: "cases_bytes.testEnum1", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testEnum2#00b47add", "#00b47add", &TLItem{tag: 0x00b47add, annotations: 0x0, tlName: "cases_bytes.testEnum2", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testEnum3#81911ffa", "#81911ffa", &TLItem{tag: 0x81911ffa, annotations: 0x0, tlName: "cases_bytes.testEnum3", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testEnumContainer#32b92037", "#32b92037", &TLItem{tag: 0x32b92037, annotations: 0x0, tlName: "cases_bytes.testEnumContainer", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testTuple#2dd3bacf", "#2dd3bacf", &TLItem{tag: 0x2dd3bacf, annotations: 0x0, tlName: "cases_bytes.testTuple", resultTypeContainsUnionTypes: false}) - fillObject("cases_bytes.testVector#3647c8ae", "#3647c8ae", &TLItem{tag: 0x3647c8ae, annotations: 0x0, tlName: "cases_bytes.testVector", resultTypeContainsUnionTypes: false}) - fillObject("cases.myCycle1#d3ca919d", "#d3ca919d", &TLItem{tag: 0xd3ca919d, annotations: 0x0, tlName: "cases.myCycle1", resultTypeContainsUnionTypes: false}) - fillObject("cases.myCycle2#5444c9a2", "#5444c9a2", &TLItem{tag: 0x5444c9a2, annotations: 0x0, tlName: "cases.myCycle2", resultTypeContainsUnionTypes: false}) - fillObject("cases.myCycle3#7624f86b", "#7624f86b", &TLItem{tag: 0x7624f86b, annotations: 0x0, tlName: "cases.myCycle3", resultTypeContainsUnionTypes: false}) - fillObject("cases.replace7#6ccce4be", "#6ccce4be", &TLItem{tag: 0x6ccce4be, annotations: 0x0, tlName: "cases.replace7", resultTypeContainsUnionTypes: false}) - fillObject("cases.replace7plus#197858f5", "#197858f5", &TLItem{tag: 0x197858f5, annotations: 0x0, tlName: "cases.replace7plus", resultTypeContainsUnionTypes: false}) - fillObject("cases.replace7plusplus#abc39b68", "#abc39b68", &TLItem{tag: 0xabc39b68, annotations: 0x0, tlName: "cases.replace7plusplus", resultTypeContainsUnionTypes: false}) - fillObject("cases.testAllPossibleFieldConfigsContainer#e3fae936", "#e3fae936", &TLItem{tag: 0xe3fae936, annotations: 0x0, tlName: "cases.testAllPossibleFieldConfigsContainer", resultTypeContainsUnionTypes: false}) - fillObject("cases.testArray#a888030d", "#a888030d", &TLItem{tag: 0xa888030d, annotations: 0x0, tlName: "cases.testArray", resultTypeContainsUnionTypes: false}) - fillObject("cases.testBeforeReadBitValidation#9b2396db", "#9b2396db", &TLItem{tag: 0x9b2396db, annotations: 0x0, tlName: "cases.testBeforeReadBitValidation", resultTypeContainsUnionTypes: false}) - fillObject("cases.testDictAny#e29b8ae6", "#e29b8ae6", &TLItem{tag: 0xe29b8ae6, annotations: 0x0, tlName: "cases.testDictAny", resultTypeContainsUnionTypes: false}) - fillObject("cases.testDictInt#d3877643", "#d3877643", &TLItem{tag: 0xd3877643, annotations: 0x0, tlName: "cases.testDictInt", resultTypeContainsUnionTypes: false}) - fillObject("cases.testDictString#c463c79b", "#c463c79b", &TLItem{tag: 0xc463c79b, annotations: 0x0, tlName: "cases.testDictString", resultTypeContainsUnionTypes: false}) - fillObject("cases.testEnum1#6c6c55ac", "#6c6c55ac", &TLItem{tag: 0x6c6c55ac, annotations: 0x0, tlName: "cases.testEnum1", resultTypeContainsUnionTypes: false}) - fillObject("cases.testEnum2#86ea88ce", "#86ea88ce", &TLItem{tag: 0x86ea88ce, annotations: 0x0, tlName: "cases.testEnum2", resultTypeContainsUnionTypes: false}) - fillObject("cases.testEnum3#69b83e2f", "#69b83e2f", &TLItem{tag: 0x69b83e2f, annotations: 0x0, tlName: "cases.testEnum3", resultTypeContainsUnionTypes: false}) - fillObject("cases.testEnumContainer#cb684231", "#cb684231", &TLItem{tag: 0xcb684231, annotations: 0x0, tlName: "cases.testEnumContainer", resultTypeContainsUnionTypes: false}) - fillObject("cases.testLocalFieldmask#f68fd3f9", "#f68fd3f9", &TLItem{tag: 0xf68fd3f9, annotations: 0x0, tlName: "cases.testLocalFieldmask", resultTypeContainsUnionTypes: false}) - fillObject("cases.testMaybe#d6602613", "#d6602613", &TLItem{tag: 0xd6602613, annotations: 0x0, tlName: "cases.testMaybe", resultTypeContainsUnionTypes: false}) - fillObject("cases.testOutFieldMaskContainer#1850ffe4", "#1850ffe4", &TLItem{tag: 0x1850ffe4, annotations: 0x0, tlName: "cases.testOutFieldMaskContainer", resultTypeContainsUnionTypes: false}) - fillObject("cases.testRecursiveFieldMask#c58cf85e", "#c58cf85e", &TLItem{tag: 0xc58cf85e, annotations: 0x0, tlName: "cases.testRecursiveFieldMask", resultTypeContainsUnionTypes: false}) - fillObject("cases.testTuple#4b9caf8f", "#4b9caf8f", &TLItem{tag: 0x4b9caf8f, annotations: 0x0, tlName: "cases.testTuple", resultTypeContainsUnionTypes: false}) - fillObject("cases.testUnion1#4b4f09b1", "#4b4f09b1", &TLItem{tag: 0x4b4f09b1, annotations: 0x0, tlName: "cases.testUnion1", resultTypeContainsUnionTypes: false}) - fillObject("cases.testUnion2#464f96c4", "#464f96c4", &TLItem{tag: 0x464f96c4, annotations: 0x0, tlName: "cases.testUnion2", resultTypeContainsUnionTypes: false}) - fillObject("cases.testUnionContainer#4497a381", "#4497a381", &TLItem{tag: 0x4497a381, annotations: 0x0, tlName: "cases.testUnionContainer", resultTypeContainsUnionTypes: false}) - fillObject("cases.testVector#4975695c", "#4975695c", &TLItem{tag: 0x4975695c, annotations: 0x0, tlName: "cases.testVector", resultTypeContainsUnionTypes: false}) - fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false}) - fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false}) - fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false}) - fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false}) - fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) - fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false}) + fillObject("benchmarks.vruhash#d31bd0fd", "#d31bd0fd", &TLItem{tag: 0xd31bd0fd, annotations: 0x0, tlName: "benchmarks.vruhash", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("benchmarks.vruposition#32792c04", "#32792c04", &TLItem{tag: 0x32792c04, annotations: 0x0, tlName: "benchmarks.vruposition", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("benchmarks.vrutoyTopLevelContainer#fb442ca5", "#fb442ca5", &TLItem{tag: 0xfb442ca5, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainer", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("benchmarks.vrutoyTopLevelContainerWithDependency#c176008e", "#c176008e", &TLItem{tag: 0xc176008e, annotations: 0x0, tlName: "benchmarks.vrutoyTopLevelContainerWithDependency", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("benchmarks.vrutoytopLevelUnionBig#ef556bee", "#ef556bee", &TLItem{tag: 0xef556bee, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionBig", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("benchmarks.vrutoytopLevelUnionEmpty#ce27c770", "#ce27c770", &TLItem{tag: 0xce27c770, annotations: 0x0, tlName: "benchmarks.vrutoytopLevelUnionEmpty", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testArray#3762fb81", "#3762fb81", &TLItem{tag: 0x3762fb81, annotations: 0x0, tlName: "cases_bytes.testArray", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testDictAny#5a5fce57", "#5a5fce57", &TLItem{tag: 0x5a5fce57, annotations: 0x0, tlName: "cases_bytes.testDictAny", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testDictInt#453ace07", "#453ace07", &TLItem{tag: 0x453ace07, annotations: 0x0, tlName: "cases_bytes.testDictInt", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testDictString#6c04d6ce", "#6c04d6ce", &TLItem{tag: 0x6c04d6ce, annotations: 0x0, tlName: "cases_bytes.testDictString", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testDictStringString#ad69c772", "#ad69c772", &TLItem{tag: 0xad69c772, annotations: 0x0, tlName: "cases_bytes.testDictStringString", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testEnum1#58aad3f5", "#58aad3f5", &TLItem{tag: 0x58aad3f5, annotations: 0x0, tlName: "cases_bytes.testEnum1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testEnum2#00b47add", "#00b47add", &TLItem{tag: 0x00b47add, annotations: 0x0, tlName: "cases_bytes.testEnum2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testEnum3#81911ffa", "#81911ffa", &TLItem{tag: 0x81911ffa, annotations: 0x0, tlName: "cases_bytes.testEnum3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testEnumContainer#32b92037", "#32b92037", &TLItem{tag: 0x32b92037, annotations: 0x0, tlName: "cases_bytes.testEnumContainer", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testTuple#2dd3bacf", "#2dd3bacf", &TLItem{tag: 0x2dd3bacf, annotations: 0x0, tlName: "cases_bytes.testTuple", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases_bytes.testVector#3647c8ae", "#3647c8ae", &TLItem{tag: 0x3647c8ae, annotations: 0x0, tlName: "cases_bytes.testVector", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.myCycle1#d3ca919d", "#d3ca919d", &TLItem{tag: 0xd3ca919d, annotations: 0x0, tlName: "cases.myCycle1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.myCycle2#5444c9a2", "#5444c9a2", &TLItem{tag: 0x5444c9a2, annotations: 0x0, tlName: "cases.myCycle2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.myCycle3#7624f86b", "#7624f86b", &TLItem{tag: 0x7624f86b, annotations: 0x0, tlName: "cases.myCycle3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.replace7#6ccce4be", "#6ccce4be", &TLItem{tag: 0x6ccce4be, annotations: 0x0, tlName: "cases.replace7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.replace7plus#197858f5", "#197858f5", &TLItem{tag: 0x197858f5, annotations: 0x0, tlName: "cases.replace7plus", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.replace7plusplus#abc39b68", "#abc39b68", &TLItem{tag: 0xabc39b68, annotations: 0x0, tlName: "cases.replace7plusplus", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testAllPossibleFieldConfigsContainer#e3fae936", "#e3fae936", &TLItem{tag: 0xe3fae936, annotations: 0x0, tlName: "cases.testAllPossibleFieldConfigsContainer", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testArray#a888030d", "#a888030d", &TLItem{tag: 0xa888030d, annotations: 0x0, tlName: "cases.testArray", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testBeforeReadBitValidation#9b2396db", "#9b2396db", &TLItem{tag: 0x9b2396db, annotations: 0x0, tlName: "cases.testBeforeReadBitValidation", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testDictAny#e29b8ae6", "#e29b8ae6", &TLItem{tag: 0xe29b8ae6, annotations: 0x0, tlName: "cases.testDictAny", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testDictInt#d3877643", "#d3877643", &TLItem{tag: 0xd3877643, annotations: 0x0, tlName: "cases.testDictInt", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testDictString#c463c79b", "#c463c79b", &TLItem{tag: 0xc463c79b, annotations: 0x0, tlName: "cases.testDictString", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testEnum1#6c6c55ac", "#6c6c55ac", &TLItem{tag: 0x6c6c55ac, annotations: 0x0, tlName: "cases.testEnum1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testEnum2#86ea88ce", "#86ea88ce", &TLItem{tag: 0x86ea88ce, annotations: 0x0, tlName: "cases.testEnum2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testEnum3#69b83e2f", "#69b83e2f", &TLItem{tag: 0x69b83e2f, annotations: 0x0, tlName: "cases.testEnum3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testEnumContainer#cb684231", "#cb684231", &TLItem{tag: 0xcb684231, annotations: 0x0, tlName: "cases.testEnumContainer", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testLocalFieldmask#f68fd3f9", "#f68fd3f9", &TLItem{tag: 0xf68fd3f9, annotations: 0x0, tlName: "cases.testLocalFieldmask", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testMaybe#d6602613", "#d6602613", &TLItem{tag: 0xd6602613, annotations: 0x0, tlName: "cases.testMaybe", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testOutFieldMaskContainer#1850ffe4", "#1850ffe4", &TLItem{tag: 0x1850ffe4, annotations: 0x0, tlName: "cases.testOutFieldMaskContainer", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testRecursiveFieldMask#c58cf85e", "#c58cf85e", &TLItem{tag: 0xc58cf85e, annotations: 0x0, tlName: "cases.testRecursiveFieldMask", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testTuple#4b9caf8f", "#4b9caf8f", &TLItem{tag: 0x4b9caf8f, annotations: 0x0, tlName: "cases.testTuple", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testUnion1#4b4f09b1", "#4b4f09b1", &TLItem{tag: 0x4b4f09b1, annotations: 0x0, tlName: "cases.testUnion1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testUnion2#464f96c4", "#464f96c4", &TLItem{tag: 0x464f96c4, annotations: 0x0, tlName: "cases.testUnion2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testUnionContainer#4497a381", "#4497a381", &TLItem{tag: 0x4497a381, annotations: 0x0, tlName: "cases.testUnionContainer", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cases.testVector#4975695c", "#4975695c", &TLItem{tag: 0x4975695c, annotations: 0x0, tlName: "cases.testVector", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) } diff --git a/internal/tlcodegen/test/gen/goldmaster.tlo.json b/internal/tlcodegen/test/gen/goldmaster.tlo.json index 445984bd..bbd01575 100644 --- a/internal/tlcodegen/test/gen/goldmaster.tlo.json +++ b/internal/tlcodegen/test/gen/goldmaster.tlo.json @@ -1,7 +1,7 @@ { "version": 301822800, "date": 301822800, - "types_num": 99, + "types_num": 100, "types": [ { "name": 1885708031, @@ -108,6 +108,12 @@ "id": "Int64", "constructors_num": 1 }, + { + "name": 47713501, + "id": "List", + "constructors_num": 1, + "arity": 1 + }, { "name": 570911930, "id": "Long", @@ -555,7 +561,7 @@ "params_type": 1 } ], - "constructor_num": 114, + "constructor_num": 115, "constructors": [ { "type": "tls.combinator_v4", @@ -1909,6 +1915,99 @@ } } }, + { + "type": "tls.combinator_v4", + "value": { + "name": 47713501, + "id": "list", + "type_name": 47713501, + "left": { + "type": "tls.combinatorLeft", + "value": { + "args_num": 4, + "args": [ + { + "id": "X", + "flags": 131075, + "var_num": 0, + "type": { + "type": "tls.typeExpr", + "value": { + "name": 753727511 + } + } + }, + { + "id": "flag", + "flags": 2, + "var_num": 1, + "type": { + "type": "tls.typeExpr", + "value": { + "name": 1885708031 + } + } + }, + { + "id": "head", + "flags": 4, + "exist_var_num": 1, + "exist_var_bit": 0, + "type": { + "type": "tls.typeVar", + "value": {} + } + }, + { + "id": "tail", + "flags": 4, + "exist_var_num": 1, + "exist_var_bit": 0, + "type": { + "type": "tls.typeExpr", + "value": { + "name": 47713501, + "flags": 1, + "children_num": 1, + "children": [ + { + "type": "tls.exprType", + "value": { + "expr": { + "type": "tls.typeVar", + "value": {} + } + } + } + ] + } + } + } + ] + } + }, + "right": { + "value": { + "type": "tls.typeExpr", + "value": { + "name": 47713501, + "children_num": 1, + "children": [ + { + "type": "tls.exprType", + "value": { + "expr": { + "type": "tls.typeVar", + "value": {} + } + } + } + ] + } + } + } + } + }, { "type": "tls.combinator_v4", "value": { @@ -9289,7 +9388,7 @@ } } ], - "functions_num": 21, + "functions_num": 24, "functions": [ { "type": "tls.combinator_v4", @@ -9326,6 +9425,61 @@ "flags": 1 } }, + { + "type": "tls.combinator_v4", + "value": { + "name": -1917672200, + "id": "ab.call10", + "type_name": -516647077, + "left": { + "type": "tls.combinatorLeft", + "value": {} + }, + "right": { + "value": { + "type": "tls.typeExpr", + "value": { + "name": -516647077 + } + } + }, + "flags": 1 + } + }, + { + "type": "tls.combinator_v4", + "value": { + "name": -323837076, + "id": "ab.call11", + "type_name": -516647077, + "left": { + "type": "tls.combinatorLeft", + "value": { + "args_num": 1, + "args": [ + { + "id": "x", + "type": { + "type": "tls.typeExpr", + "value": { + "name": -516647077 + } + } + } + ] + } + }, + "right": { + "value": { + "type": "tls.typeExpr", + "value": { + "name": -516647077 + } + } + }, + "flags": 1 + } + }, { "type": "tls.combinator_v4", "value": { @@ -9970,6 +10124,69 @@ "flags": 3 } }, + { + "type": "tls.combinator_v4", + "value": { + "name": 2096325308, + "id": "service5.insertList", + "type_name": 47713501, + "left": { + "type": "tls.combinatorLeft", + "value": { + "args_num": 2, + "args": [ + { + "id": "flags", + "flags": 2, + "var_num": 0, + "type": { + "type": "tls.typeExpr", + "value": { + "name": 1885708031 + } + } + }, + { + "id": "persistent", + "flags": 4, + "exist_var_num": 0, + "exist_var_bit": 0, + "type": { + "type": "tls.typeExpr", + "value": { + "name": 1072550713, + "flags": 1 + } + } + } + ] + } + }, + "right": { + "value": { + "type": "tls.typeExpr", + "value": { + "name": 47713501, + "children_num": 1, + "children": [ + { + "type": "tls.exprType", + "value": { + "expr": { + "type": "tls.typeExpr", + "value": { + "name": 597193292 + } + } + } + } + ] + } + } + }, + "flags": 3 + } + }, { "type": "tls.combinator_v4", "value": { diff --git a/internal/tlcodegen/test/gen/goldmaster/constants/constants.go b/internal/tlcodegen/test/gen/goldmaster/constants/constants.go index 86b0ca1b..c60bb096 100644 --- a/internal/tlcodegen/test/gen/goldmaster/constants/constants.go +++ b/internal/tlcodegen/test/gen/goldmaster/constants/constants.go @@ -22,6 +22,7 @@ const ( AbAlias = 0x944aaa97 // ab.alias AbCall1 = 0x20c5fb2d // ab.call1 AbCall10 = 0x8db2a4f8 // ab.call10 + AbCall11 = 0xecb2a36c // ab.call11 AbCall2 = 0x77d5f057 // ab.call2 AbCall3 = 0x0a083445 // ab.call3 AbCall4 = 0xc1220a1e // ab.call4 diff --git a/internal/tlcodegen/test/gen/goldmaster/factory/factory.go b/internal/tlcodegen/test/gen/goldmaster/factory/factory.go index f5cef616..b7e76e64 100644 --- a/internal/tlcodegen/test/gen/goldmaster/factory/factory.go +++ b/internal/tlcodegen/test/gen/goldmaster/factory/factory.go @@ -68,6 +68,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tla/tlATop2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4" @@ -128,6 +129,7 @@ func init() { meta.SetGlobalFactoryCreateForObject(0x944aaa97, func() meta.Object { var ret cycle_b62dd5050d0a18c7485fd980c087f32c.AbAlias; return &ret }) meta.SetGlobalFactoryCreateForFunction(0x20c5fb2d, func() meta.Object { var ret tlAbCall1.AbCall1; return &ret }, func() meta.Function { var ret tlAbCall1.AbCall1; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x8db2a4f8, func() meta.Object { var ret tlAbCall10.AbCall10; return &ret }, func() meta.Function { var ret tlAbCall10.AbCall10; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunction(0xecb2a36c, func() meta.Object { var ret tlAbCall11.AbCall11; return &ret }, func() meta.Function { var ret tlAbCall11.AbCall11; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x77d5f057, func() meta.Object { var ret tlAbCall2.AbCall2; return &ret }, func() meta.Function { var ret tlAbCall2.AbCall2; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x0a083445, func() meta.Object { var ret tlAbCall3.AbCall3; return &ret }, func() meta.Function { var ret tlAbCall3.AbCall3; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0xc1220a1e, func() meta.Object { var ret tlAbCall4.AbCall4; return &ret }, func() meta.Function { var ret tlAbCall4.AbCall4; return &ret }, nil) diff --git a/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go b/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go index 4e158857..49a70b17 100644 --- a/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go +++ b/internal/tlcodegen/test/gen/goldmaster/factory_bytes/factory_bytes.go @@ -68,6 +68,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tla/tlATop2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4" @@ -128,6 +129,7 @@ func init() { meta.SetGlobalFactoryCreateForObjectBytes(0x944aaa97, func() meta.Object { var ret cycle_b62dd5050d0a18c7485fd980c087f32c.AbAlias; return &ret }) meta.SetGlobalFactoryCreateForFunctionBytes(0x20c5fb2d, func() meta.Object { var ret tlAbCall1.AbCall1; return &ret }, func() meta.Function { var ret tlAbCall1.AbCall1; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x8db2a4f8, func() meta.Object { var ret tlAbCall10.AbCall10; return &ret }, func() meta.Function { var ret tlAbCall10.AbCall10; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunctionBytes(0xecb2a36c, func() meta.Object { var ret tlAbCall11.AbCall11; return &ret }, func() meta.Function { var ret tlAbCall11.AbCall11; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x77d5f057, func() meta.Object { var ret tlAbCall2.AbCall2; return &ret }, func() meta.Function { var ret tlAbCall2.AbCall2; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x0a083445, func() meta.Object { var ret tlAbCall3.AbCall3; return &ret }, func() meta.Function { var ret tlAbCall3.AbCall3; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0xc1220a1e, func() meta.Object { var ret tlAbCall4.AbCall4; return &ret }, func() meta.Function { var ret tlAbCall4.AbCall4; return &ret }, nil) diff --git a/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11/ab.call11.go b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11/ab.call11.go new file mode 100644 index 00000000..9b23be97 --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11/ab.call11.go @@ -0,0 +1,183 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package tlAbCall11 + +import ( + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tla/tlAColor" + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite +var _ = internal.ErrorInvalidEnumTag + +type AbCall11 struct { + X tlAColor.AColor +} + +func (AbCall11) TLName() string { return "ab.call11" } +func (AbCall11) TLTag() uint32 { return 0xecb2a36c } + +func (item *AbCall11) Reset() { + item.X.Reset() +} + +func (item *AbCall11) FillRandom(rg *basictl.RandGenerator) { + item.X.FillRandom(rg) +} + +func (item *AbCall11) Read(w []byte) (_ []byte, err error) { + return item.X.ReadBoxed(w) +} + +// This method is general version of Write, use it instead! +func (item *AbCall11) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *AbCall11) Write(w []byte) []byte { + w = item.X.WriteBoxed(w) + return w +} + +func (item *AbCall11) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0xecb2a36c); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *AbCall11) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *AbCall11) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0xecb2a36c) + return item.Write(w) +} + +func (item *AbCall11) ReadResult(w []byte, ret *tlAColor.AColor) (_ []byte, err error) { + return ret.ReadBoxed(w) +} + +func (item *AbCall11) WriteResult(w []byte, ret tlAColor.AColor) (_ []byte, err error) { + w = ret.WriteBoxed(w) + return w, nil +} + +func (item *AbCall11) ReadResultJSON(legacyTypeNames bool, in *basictl.JsonLexer, ret *tlAColor.AColor) error { + if err := ret.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + return nil +} + +func (item *AbCall11) WriteResultJSON(w []byte, ret tlAColor.AColor) (_ []byte, err error) { + return item.writeResultJSON(true, false, w, ret) +} + +func (item *AbCall11) writeResultJSON(newTypeNames bool, short bool, w []byte, ret tlAColor.AColor) (_ []byte, err error) { + w = ret.WriteJSONOpt(newTypeNames, short, w) + return w, nil +} + +func (item *AbCall11) ReadResultWriteResultJSON(r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret tlAColor.AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.WriteResultJSON(w, ret) + return r, w, err +} + +func (item *AbCall11) ReadResultWriteResultJSONOpt(newTypeNames bool, short bool, r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret tlAColor.AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.writeResultJSON(newTypeNames, short, w, ret) + return r, w, err +} + +func (item *AbCall11) ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) { + var ret tlAColor.AColor + err := item.ReadResultJSON(true, &basictl.JsonLexer{Data: r}, &ret) + if err != nil { + return r, w, err + } + w, err = item.WriteResult(w, ret) + return r, w, err +} + +func (item AbCall11) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *AbCall11) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + var propXPresented bool + + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + key := in.UnsafeFieldName(true) + in.WantColon() + switch key { + case "x": + if propXPresented { + return internal.ErrorInvalidJSONWithDuplicatingKeys("ab.call11", "x") + } + if err := item.X.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + propXPresented = true + default: + return internal.ErrorInvalidJSONExcessElement("ab.call11", key) + } + in.WantComma() + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + if !propXPresented { + item.X.Reset() + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *AbCall11) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *AbCall11) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *AbCall11) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"x":`...) + w = item.X.WriteJSONOpt(newTypeNames, short, w) + return append(w, '}') +} + +func (item *AbCall11) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *AbCall11) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return internal.ErrorInvalidJSON("ab.call11", err.Error()) + } + return nil +} diff --git a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go index dcae79d4..7375dbdb 100644 --- a/internal/tlcodegen/test/gen/goldmaster/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster/meta/meta.go @@ -133,7 +133,8 @@ type TLItem struct { annotations uint32 tlName string - resultTypeContainsUnionTypes bool + resultTypeContainsUnionTypes bool + argumentsTypesContainUnionTypes bool createFunction func() Function createFunctionLong func() Function @@ -149,7 +150,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInArguments() bool { return item.argumentsTypesContainUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -303,109 +305,110 @@ func fillFunction(n1 string, n2 string, item *TLItem) { } func init() { - fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue", resultTypeContainsUnionTypes: false}) - fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color", resultTypeContainsUnionTypes: false}) - fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green", resultTypeContainsUnionTypes: false}) - fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red", resultTypeContainsUnionTypes: false}) - fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2", resultTypeContainsUnionTypes: false}) - fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false}) - fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call10#8db2a4f8", "#8db2a4f8", &TLItem{tag: 0x8db2a4f8, annotations: 0x1, tlName: "ab.call10", resultTypeContainsUnionTypes: true}) - fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9", resultTypeContainsUnionTypes: false}) - fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code", resultTypeContainsUnionTypes: false}) - fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany", resultTypeContainsUnionTypes: false}) - fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne", resultTypeContainsUnionTypes: false}) - fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty", resultTypeContainsUnionTypes: false}) - fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType", resultTypeContainsUnionTypes: false}) - fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe", resultTypeContainsUnionTypes: false}) - fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1", resultTypeContainsUnionTypes: false}) - fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD", resultTypeContainsUnionTypes: false}) - fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle", resultTypeContainsUnionTypes: false}) - fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString", resultTypeContainsUnionTypes: false}) - fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA", resultTypeContainsUnionTypes: false}) - fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red", resultTypeContainsUnionTypes: false}) - fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1", resultTypeContainsUnionTypes: false}) - fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2", resultTypeContainsUnionTypes: false}) - fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3", resultTypeContainsUnionTypes: false}) - fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4", resultTypeContainsUnionTypes: false}) - fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5", resultTypeContainsUnionTypes: false}) - fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6", resultTypeContainsUnionTypes: false}) - fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7", resultTypeContainsUnionTypes: false}) - fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8", resultTypeContainsUnionTypes: false}) - fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9", resultTypeContainsUnionTypes: false}) - fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType", resultTypeContainsUnionTypes: false}) - fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response", resultTypeContainsUnionTypes: false}) - fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD", resultTypeContainsUnionTypes: false}) - fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle", resultTypeContainsUnionTypes: false}) - fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle", resultTypeContainsUnionTypes: false}) - fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle", resultTypeContainsUnionTypes: false}) - fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle", resultTypeContainsUnionTypes: false}) - fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple", resultTypeContainsUnionTypes: false}) - fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr", resultTypeContainsUnionTypes: false}) - fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren", resultTypeContainsUnionTypes: false}) - fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false}) - fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false}) - fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false}) - fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false}) - fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1", resultTypeContainsUnionTypes: false}) - fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint", resultTypeContainsUnionTypes: false}) - fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32", resultTypeContainsUnionTypes: false}) - fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64", resultTypeContainsUnionTypes: false}) - fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat", resultTypeContainsUnionTypes: false}) - fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus", resultTypeContainsUnionTypes: false}) - fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3", resultTypeContainsUnionTypes: false}) - fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero", resultTypeContainsUnionTypes: false}) - fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3", resultTypeContainsUnionTypes: false}) - fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers", resultTypeContainsUnionTypes: false}) - fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr", resultTypeContainsUnionTypes: false}) - fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace", resultTypeContainsUnionTypes: false}) - fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10", resultTypeContainsUnionTypes: false}) - fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12", resultTypeContainsUnionTypes: false}) - fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15", resultTypeContainsUnionTypes: false}) - fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17", resultTypeContainsUnionTypes: false}) - fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18", resultTypeContainsUnionTypes: false}) - fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2", resultTypeContainsUnionTypes: false}) - fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3", resultTypeContainsUnionTypes: false}) - fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5", resultTypeContainsUnionTypes: false}) - fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6", resultTypeContainsUnionTypes: false}) - fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7", resultTypeContainsUnionTypes: false}) - fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false}) - fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false}) - fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false}) - fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true}) - fillFunction("service5.insertList#7cf362bc", "#7cf362bc", &TLItem{tag: 0x7cf362bc, annotations: 0x2, tlName: "service5.insertList", resultTypeContainsUnionTypes: true}) - fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false}) - fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true}) - fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false}) - fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false}) - fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) - fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe", resultTypeContainsUnionTypes: false}) - fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2", resultTypeContainsUnionTypes: false}) - fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false}) - fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA", resultTypeContainsUnionTypes: false}) - fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB", resultTypeContainsUnionTypes: false}) - fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC", resultTypeContainsUnionTypes: false}) - fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD", resultTypeContainsUnionTypes: false}) - fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse", resultTypeContainsUnionTypes: false}) - fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly", resultTypeContainsUnionTypes: false}) - fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse", resultTypeContainsUnionTypes: false}) - fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr", resultTypeContainsUnionTypes: false}) - fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue", resultTypeContainsUnionTypes: false}) - fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity", resultTypeContainsUnionTypes: false}) + fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call10#8db2a4f8", "#8db2a4f8", &TLItem{tag: 0x8db2a4f8, annotations: 0x1, tlName: "ab.call10", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call11#ecb2a36c", "#ecb2a36c", &TLItem{tag: 0xecb2a36c, annotations: 0x1, tlName: "ab.call11", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: true}) + fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillFunction("service5.insertList#7cf362bc", "#7cf362bc", &TLItem{tag: 0x7cf362bc, annotations: 0x2, tlName: "service5.insertList", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) } diff --git a/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go b/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go index 434599e5..5baea982 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go +++ b/internal/tlcodegen/test/gen/goldmaster/tlab/tlab.go @@ -14,6 +14,7 @@ import ( "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tl/tlAbMyTypeMaybe" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall1" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall10" + "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall11" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall2" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall3" "github.com/vkcom/tl/internal/tlcodegen/test/gen/goldmaster/internal/tlab/tlAbCall4" @@ -38,6 +39,7 @@ type ( Alias = cycle_b62dd5050d0a18c7485fd980c087f32c.AbAlias Call1 = tlAbCall1.AbCall1 Call10 = tlAbCall10.AbCall10 + Call11 = tlAbCall11.AbCall11 Call2 = tlAbCall2.AbCall2 Call3 = tlAbCall3.AbCall3 Call4 = tlAbCall4.AbCall4 diff --git a/internal/tlcodegen/test/gen/goldmaster/tljson.html b/internal/tlcodegen/test/gen/goldmaster/tljson.html index d80fde58..d0ffeacc 100644 --- a/internal/tlcodegen/test/gen/goldmaster/tljson.html +++ b/internal/tlcodegen/test/gen/goldmaster/tljson.html @@ -26,6 +26,11 @@

    Functions

    ab.call10a.Color
  • +
  • + + ab.call11 + → a.Color +
  • ab.call2 @@ -436,6 +441,31 @@

    ab.call10

    +

    ab.call11

    + +

    + Returns a.Color +
    +
    JSON
    +
    + { + + + + + + + +
      "x": a.Color +
    + } +
    +
    TL
    +
    + read ab.call11#ecb2a36c x:a.Color = a.Color; +
    +
    +

    ab.call2

    diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/constants/constants.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/constants/constants.go index c75b695a..c60bb096 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/constants/constants.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/constants/constants.go @@ -21,6 +21,8 @@ const ( Aaa = 0x05b0e500 // aaa AbAlias = 0x944aaa97 // ab.alias AbCall1 = 0x20c5fb2d // ab.call1 + AbCall10 = 0x8db2a4f8 // ab.call10 + AbCall11 = 0xecb2a36c // ab.call11 AbCall2 = 0x77d5f057 // ab.call2 AbCall3 = 0x0a083445 // ab.call3 AbCall4 = 0xc1220a1e // ab.call4 @@ -82,6 +84,7 @@ const ( Int = 0xa8509bda // int Int32 = 0x7934e71f // int32 Int64 = 0xf5609de0 // int64 + List = 0x02d80cdd // list Long = 0x22076cba // long MaybeTest1 = 0xc457763c // maybeTest1 MaybeWrapper = 0x723390c4 // maybeWrapper @@ -118,6 +121,7 @@ const ( ResultTrue = 0x3f9c8ef8 // resultTrue Service5EmptyOutput = 0xff8f7db8 // service5.emptyOutput Service5Insert = 0x7cf362ba // service5.insert + Service5InsertList = 0x7cf362bc // service5.insertList Service5StringOutput = 0xdc170ff4 // service5.stringOutput Service5LongEmptyOutput = 0xff8f7db9 // service5Long.emptyOutput Service5LongInsert = 0x7cf362bb // service5Long.insert diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/factory/factory.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/factory/factory.go index 622a2dca..66b8fc86 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/factory/factory.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/factory/factory.go @@ -39,6 +39,8 @@ func init() { meta.SetGlobalFactoryCreateForObject(0xa7662843, func() meta.Object { var ret internal.AUNionA; return &ret }) meta.SetGlobalFactoryCreateForObject(0x944aaa97, func() meta.Object { var ret internal.AbAlias; return &ret }) meta.SetGlobalFactoryCreateForFunction(0x20c5fb2d, func() meta.Object { var ret internal.AbCall1; return &ret }, func() meta.Function { var ret internal.AbCall1; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunction(0x8db2a4f8, func() meta.Object { var ret internal.AbCall10; return &ret }, func() meta.Function { var ret internal.AbCall10; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunction(0xecb2a36c, func() meta.Object { var ret internal.AbCall11; return &ret }, func() meta.Function { var ret internal.AbCall11; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x77d5f057, func() meta.Object { var ret internal.AbCall2; return &ret }, func() meta.Function { var ret internal.AbCall2; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0x0a083445, func() meta.Object { var ret internal.AbCall3; return &ret }, func() meta.Function { var ret internal.AbCall3; return &ret }, nil) meta.SetGlobalFactoryCreateForFunction(0xc1220a1e, func() meta.Object { var ret internal.AbCall4; return &ret }, func() meta.Function { var ret internal.AbCall4; return &ret }, nil) @@ -116,6 +118,7 @@ func init() { meta.SetGlobalFactoryCreateForObject(0x95d598c5, func() meta.Object { var ret internal.Replace9; return &ret }) meta.SetGlobalFactoryCreateForObject(0xff8f7db8, func() meta.Object { var ret internal.Service5EmptyOutput; return &ret }) meta.SetGlobalFactoryCreateForFunction(0x7cf362ba, func() meta.Object { var ret internal.Service5Insert; return &ret }, func() meta.Function { var ret internal.Service5Insert; return &ret }, func() meta.Function { var ret internal.Service5LongInsert; return &ret }) + meta.SetGlobalFactoryCreateForFunction(0x7cf362bc, func() meta.Object { var ret internal.Service5InsertList; return &ret }, func() meta.Function { var ret internal.Service5InsertList; return &ret }, nil) meta.SetGlobalFactoryCreateForObject(0xff8f7db9, func() meta.Object { var ret internal.Service5LongEmptyOutput; return &ret }) meta.SetGlobalFactoryCreateForFunction(0x7cf362bb, func() meta.Object { var ret internal.Service5LongInsert; return &ret }, func() meta.Function { var ret internal.Service5LongInsert; return &ret }, nil) meta.SetGlobalFactoryCreateForObject(0xdc170ff5, func() meta.Object { var ret internal.Service5LongStringOutput; return &ret }) diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/factory_bytes/factory_bytes.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/factory_bytes/factory_bytes.go index d90875ac..7e5c4f1b 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/factory_bytes/factory_bytes.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/factory_bytes/factory_bytes.go @@ -39,6 +39,8 @@ func init() { meta.SetGlobalFactoryCreateForObjectBytes(0xa7662843, func() meta.Object { var ret internal.AUNionA; return &ret }) meta.SetGlobalFactoryCreateForObjectBytes(0x944aaa97, func() meta.Object { var ret internal.AbAlias; return &ret }) meta.SetGlobalFactoryCreateForFunctionBytes(0x20c5fb2d, func() meta.Object { var ret internal.AbCall1; return &ret }, func() meta.Function { var ret internal.AbCall1; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunctionBytes(0x8db2a4f8, func() meta.Object { var ret internal.AbCall10; return &ret }, func() meta.Function { var ret internal.AbCall10; return &ret }, nil) + meta.SetGlobalFactoryCreateForFunctionBytes(0xecb2a36c, func() meta.Object { var ret internal.AbCall11; return &ret }, func() meta.Function { var ret internal.AbCall11; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x77d5f057, func() meta.Object { var ret internal.AbCall2; return &ret }, func() meta.Function { var ret internal.AbCall2; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0x0a083445, func() meta.Object { var ret internal.AbCall3; return &ret }, func() meta.Function { var ret internal.AbCall3; return &ret }, nil) meta.SetGlobalFactoryCreateForFunctionBytes(0xc1220a1e, func() meta.Object { var ret internal.AbCall4; return &ret }, func() meta.Function { var ret internal.AbCall4; return &ret }, nil) @@ -116,6 +118,7 @@ func init() { meta.SetGlobalFactoryCreateForObjectBytes(0x95d598c5, func() meta.Object { var ret internal.Replace9; return &ret }) meta.SetGlobalFactoryCreateForObjectBytes(0xff8f7db8, func() meta.Object { var ret internal.Service5EmptyOutput; return &ret }) meta.SetGlobalFactoryCreateForFunctionBytes(0x7cf362ba, func() meta.Object { var ret internal.Service5Insert; return &ret }, func() meta.Function { var ret internal.Service5Insert; return &ret }, func() meta.Function { var ret internal.Service5LongInsert; return &ret }) + meta.SetGlobalFactoryCreateForFunctionBytes(0x7cf362bc, func() meta.Object { var ret internal.Service5InsertList; return &ret }, func() meta.Function { var ret internal.Service5InsertList; return &ret }, nil) meta.SetGlobalFactoryCreateForObjectBytes(0xff8f7db9, func() meta.Object { var ret internal.Service5LongEmptyOutput; return &ret }) meta.SetGlobalFactoryCreateForFunctionBytes(0x7cf362bb, func() meta.Object { var ret internal.Service5LongInsert; return &ret }, func() meta.Function { var ret internal.Service5LongInsert; return &ret }, nil) meta.SetGlobalFactoryCreateForObjectBytes(0xdc170ff5, func() meta.Object { var ret internal.Service5LongStringOutput; return &ret }) diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call10.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call10.go new file mode 100644 index 00000000..0a63f6ed --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call10.go @@ -0,0 +1,150 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package internal + +import ( + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite + +type AbCall10 struct { +} + +func (AbCall10) TLName() string { return "ab.call10" } +func (AbCall10) TLTag() uint32 { return 0x8db2a4f8 } + +func (item *AbCall10) Reset() {} + +func (item *AbCall10) FillRandom(rg *basictl.RandGenerator) {} + +func (item *AbCall10) Read(w []byte) (_ []byte, err error) { return w, nil } + +// This method is general version of Write, use it instead! +func (item *AbCall10) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *AbCall10) Write(w []byte) []byte { + return w +} + +func (item *AbCall10) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0x8db2a4f8); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *AbCall10) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *AbCall10) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0x8db2a4f8) + return item.Write(w) +} + +func (item *AbCall10) ReadResult(w []byte, ret *AColor) (_ []byte, err error) { + return ret.ReadBoxed(w) +} + +func (item *AbCall10) WriteResult(w []byte, ret AColor) (_ []byte, err error) { + w = ret.WriteBoxed(w) + return w, nil +} + +func (item *AbCall10) ReadResultJSON(legacyTypeNames bool, in *basictl.JsonLexer, ret *AColor) error { + if err := ret.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + return nil +} + +func (item *AbCall10) WriteResultJSON(w []byte, ret AColor) (_ []byte, err error) { + return item.writeResultJSON(true, false, w, ret) +} + +func (item *AbCall10) writeResultJSON(newTypeNames bool, short bool, w []byte, ret AColor) (_ []byte, err error) { + w = ret.WriteJSONOpt(newTypeNames, short, w) + return w, nil +} + +func (item *AbCall10) ReadResultWriteResultJSON(r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.WriteResultJSON(w, ret) + return r, w, err +} + +func (item *AbCall10) ReadResultWriteResultJSONOpt(newTypeNames bool, short bool, r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.writeResultJSON(newTypeNames, short, w, ret) + return r, w, err +} + +func (item *AbCall10) ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) { + var ret AColor + err := item.ReadResultJSON(true, &basictl.JsonLexer{Data: r}, &ret) + if err != nil { + return r, w, err + } + w, err = item.WriteResult(w, ret) + return r, w, err +} + +func (item AbCall10) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *AbCall10) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + return ErrorInvalidJSON("ab.call10", "this object can't have properties") + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *AbCall10) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *AbCall10) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *AbCall10) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + return append(w, '}') +} + +func (item *AbCall10) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *AbCall10) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return ErrorInvalidJSON("ab.call10", err.Error()) + } + return nil +} diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call11.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call11.go new file mode 100644 index 00000000..2f83dcba --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/ab.call11.go @@ -0,0 +1,180 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package internal + +import ( + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite + +type AbCall11 struct { + X AColor +} + +func (AbCall11) TLName() string { return "ab.call11" } +func (AbCall11) TLTag() uint32 { return 0xecb2a36c } + +func (item *AbCall11) Reset() { + item.X.Reset() +} + +func (item *AbCall11) FillRandom(rg *basictl.RandGenerator) { + item.X.FillRandom(rg) +} + +func (item *AbCall11) Read(w []byte) (_ []byte, err error) { + return item.X.ReadBoxed(w) +} + +// This method is general version of Write, use it instead! +func (item *AbCall11) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *AbCall11) Write(w []byte) []byte { + w = item.X.WriteBoxed(w) + return w +} + +func (item *AbCall11) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0xecb2a36c); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *AbCall11) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *AbCall11) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0xecb2a36c) + return item.Write(w) +} + +func (item *AbCall11) ReadResult(w []byte, ret *AColor) (_ []byte, err error) { + return ret.ReadBoxed(w) +} + +func (item *AbCall11) WriteResult(w []byte, ret AColor) (_ []byte, err error) { + w = ret.WriteBoxed(w) + return w, nil +} + +func (item *AbCall11) ReadResultJSON(legacyTypeNames bool, in *basictl.JsonLexer, ret *AColor) error { + if err := ret.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + return nil +} + +func (item *AbCall11) WriteResultJSON(w []byte, ret AColor) (_ []byte, err error) { + return item.writeResultJSON(true, false, w, ret) +} + +func (item *AbCall11) writeResultJSON(newTypeNames bool, short bool, w []byte, ret AColor) (_ []byte, err error) { + w = ret.WriteJSONOpt(newTypeNames, short, w) + return w, nil +} + +func (item *AbCall11) ReadResultWriteResultJSON(r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.WriteResultJSON(w, ret) + return r, w, err +} + +func (item *AbCall11) ReadResultWriteResultJSONOpt(newTypeNames bool, short bool, r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret AColor + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.writeResultJSON(newTypeNames, short, w, ret) + return r, w, err +} + +func (item *AbCall11) ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) { + var ret AColor + err := item.ReadResultJSON(true, &basictl.JsonLexer{Data: r}, &ret) + if err != nil { + return r, w, err + } + w, err = item.WriteResult(w, ret) + return r, w, err +} + +func (item AbCall11) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *AbCall11) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + var propXPresented bool + + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + key := in.UnsafeFieldName(true) + in.WantColon() + switch key { + case "x": + if propXPresented { + return ErrorInvalidJSONWithDuplicatingKeys("ab.call11", "x") + } + if err := item.X.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + propXPresented = true + default: + return ErrorInvalidJSONExcessElement("ab.call11", key) + } + in.WantComma() + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + if !propXPresented { + item.X.Reset() + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *AbCall11) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *AbCall11) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *AbCall11) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"x":`...) + w = item.X.WriteJSONOpt(newTypeNames, short, w) + return append(w, '}') +} + +func (item *AbCall11) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *AbCall11) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return ErrorInvalidJSON("ab.call11", err.Error()) + } + return nil +} diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/list.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/list.go new file mode 100644 index 00000000..470f36e5 --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/list.go @@ -0,0 +1,261 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package internal + +import ( + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite + +type ListService5Output struct { + Flag uint32 + Head Service5Output // Conditional: item.Flag.0 + Tail *ListService5Output // Conditional: item.Flag.0 +} + +func (ListService5Output) TLName() string { return "list" } +func (ListService5Output) TLTag() uint32 { return 0x02d80cdd } + +func (item *ListService5Output) SetHead(v Service5Output) { + item.Head = v + item.Flag |= 1 << 0 +} +func (item *ListService5Output) ClearHead() { + item.Head.Reset() + item.Flag &^= 1 << 0 +} +func (item ListService5Output) IsSetHead() bool { return item.Flag&(1<<0) != 0 } + +func (item *ListService5Output) SetTail(v ListService5Output) { + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + *item.Tail = v + item.Flag |= 1 << 0 +} +func (item *ListService5Output) ClearTail() { + if item.Tail != nil { + item.Tail.Reset() + } + item.Flag &^= 1 << 0 +} +func (item ListService5Output) IsSetTail() bool { return item.Flag&(1<<0) != 0 } + +func (item *ListService5Output) Reset() { + item.Flag = 0 + item.Head.Reset() + if item.Tail != nil { + item.Tail.Reset() + } +} + +func (item *ListService5Output) FillRandom(rg *basictl.RandGenerator) { + var maskFlag uint32 + maskFlag = basictl.RandomUint(rg) + item.Flag = 0 + if maskFlag&(1<<0) != 0 { + item.Flag |= (1 << 0) + } + if item.Flag&(1<<0) != 0 { + item.Head.FillRandom(rg) + } else { + item.Head.Reset() + } + if item.Flag&(1<<0) != 0 { + rg.IncreaseDepth() + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + item.Tail.FillRandom(rg) + rg.DecreaseDepth() + } else { + if item.Tail != nil { + item.Tail.Reset() + } + } +} + +func (item *ListService5Output) Read(w []byte) (_ []byte, err error) { + if w, err = basictl.NatRead(w, &item.Flag); err != nil { + return w, err + } + if item.Flag&(1<<0) != 0 { + if w, err = item.Head.ReadBoxed(w); err != nil { + return w, err + } + } else { + item.Head.Reset() + } + if item.Flag&(1<<0) != 0 { + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + if w, err = item.Tail.Read(w); err != nil { + return w, err + } + } else { + if item.Tail != nil { + item.Tail.Reset() + } + } + return w, nil +} + +// This method is general version of Write, use it instead! +func (item *ListService5Output) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *ListService5Output) Write(w []byte) []byte { + w = basictl.NatWrite(w, item.Flag) + if item.Flag&(1<<0) != 0 { + w = item.Head.WriteBoxed(w) + } + if item.Flag&(1<<0) != 0 { + w = item.Tail.Write(w) + } + return w +} + +func (item *ListService5Output) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0x02d80cdd); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *ListService5Output) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *ListService5Output) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0x02d80cdd) + return item.Write(w) +} + +func (item ListService5Output) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *ListService5Output) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + var propFlagPresented bool + var propHeadPresented bool + var propTailPresented bool + + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + key := in.UnsafeFieldName(true) + in.WantColon() + switch key { + case "flag": + if propFlagPresented { + return ErrorInvalidJSONWithDuplicatingKeys("list", "flag") + } + if err := Json2ReadUint32(in, &item.Flag); err != nil { + return err + } + propFlagPresented = true + case "head": + if propHeadPresented { + return ErrorInvalidJSONWithDuplicatingKeys("list", "head") + } + if err := item.Head.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + propHeadPresented = true + case "tail": + if propTailPresented { + return ErrorInvalidJSONWithDuplicatingKeys("list", "tail") + } + if item.Tail == nil { + var value ListService5Output + item.Tail = &value + } + if err := item.Tail.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + propTailPresented = true + default: + return ErrorInvalidJSONExcessElement("list", key) + } + in.WantComma() + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + if !propFlagPresented { + item.Flag = 0 + } + if !propHeadPresented { + item.Head.Reset() + } + if !propTailPresented { + if item.Tail != nil { + item.Tail.Reset() + } + } + if propHeadPresented { + item.Flag |= 1 << 0 + } + if propTailPresented { + item.Flag |= 1 << 0 + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *ListService5Output) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *ListService5Output) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *ListService5Output) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + backupIndexFlag := len(w) + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"flag":`...) + w = basictl.JSONWriteUint32(w, item.Flag) + if (item.Flag != 0) == false { + w = w[:backupIndexFlag] + } + if item.Flag&(1<<0) != 0 { + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"head":`...) + w = item.Head.WriteJSONOpt(newTypeNames, short, w) + } + if item.Flag&(1<<0) != 0 { + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"tail":`...) + w = item.Tail.WriteJSONOpt(newTypeNames, short, w) + } + return append(w, '}') +} + +func (item *ListService5Output) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *ListService5Output) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return ErrorInvalidJSON("list", err.Error()) + } + return nil +} diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insertList.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insertList.go new file mode 100644 index 00000000..90a150ce --- /dev/null +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/internal/service5.insertList.go @@ -0,0 +1,225 @@ +// Copyright 2022 V Kontakte LLC +// +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at https://mozilla.org/MPL/2.0/. + +// Code generated by vktl/cmd/tlgen2; DO NOT EDIT. +package internal + +import ( + "github.com/vkcom/tl/pkg/basictl" +) + +var _ = basictl.NatWrite + +type Service5InsertList struct { + Flags uint32 + // Persistent (TrueType) // Conditional: item.Flags.0 +} + +func (Service5InsertList) TLName() string { return "service5.insertList" } +func (Service5InsertList) TLTag() uint32 { return 0x7cf362bc } + +func (item *Service5InsertList) SetPersistent(v bool) { + if v { + item.Flags |= 1 << 0 + } else { + item.Flags &^= 1 << 0 + } +} +func (item Service5InsertList) IsSetPersistent() bool { return item.Flags&(1<<0) != 0 } + +func (item *Service5InsertList) Reset() { + item.Flags = 0 +} + +func (item *Service5InsertList) FillRandom(rg *basictl.RandGenerator) { + var maskFlags uint32 + maskFlags = basictl.RandomUint(rg) + item.Flags = 0 + if maskFlags&(1<<0) != 0 { + item.Flags |= (1 << 0) + } +} + +func (item *Service5InsertList) Read(w []byte) (_ []byte, err error) { + if w, err = basictl.NatRead(w, &item.Flags); err != nil { + return w, err + } + return w, nil +} + +// This method is general version of Write, use it instead! +func (item *Service5InsertList) WriteGeneral(w []byte) (_ []byte, err error) { + return item.Write(w), nil +} + +func (item *Service5InsertList) Write(w []byte) []byte { + w = basictl.NatWrite(w, item.Flags) + return w +} + +func (item *Service5InsertList) ReadBoxed(w []byte) (_ []byte, err error) { + if w, err = basictl.NatReadExactTag(w, 0x7cf362bc); err != nil { + return w, err + } + return item.Read(w) +} + +// This method is general version of WriteBoxed, use it instead! +func (item *Service5InsertList) WriteBoxedGeneral(w []byte) (_ []byte, err error) { + return item.WriteBoxed(w), nil +} + +func (item *Service5InsertList) WriteBoxed(w []byte) []byte { + w = basictl.NatWrite(w, 0x7cf362bc) + return item.Write(w) +} + +func (item *Service5InsertList) ReadResult(w []byte, ret *ListService5Output) (_ []byte, err error) { + return ret.ReadBoxed(w) +} + +func (item *Service5InsertList) WriteResult(w []byte, ret ListService5Output) (_ []byte, err error) { + w = ret.WriteBoxed(w) + return w, nil +} + +func (item *Service5InsertList) ReadResultJSON(legacyTypeNames bool, in *basictl.JsonLexer, ret *ListService5Output) error { + if err := ret.ReadJSON(legacyTypeNames, in); err != nil { + return err + } + return nil +} + +func (item *Service5InsertList) WriteResultJSON(w []byte, ret ListService5Output) (_ []byte, err error) { + return item.writeResultJSON(true, false, w, ret) +} + +func (item *Service5InsertList) writeResultJSON(newTypeNames bool, short bool, w []byte, ret ListService5Output) (_ []byte, err error) { + w = ret.WriteJSONOpt(newTypeNames, short, w) + return w, nil +} + +func (item *Service5InsertList) ReadResultWriteResultJSON(r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret ListService5Output + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.WriteResultJSON(w, ret) + return r, w, err +} + +func (item *Service5InsertList) ReadResultWriteResultJSONOpt(newTypeNames bool, short bool, r []byte, w []byte) (_ []byte, _ []byte, err error) { + var ret ListService5Output + if r, err = item.ReadResult(r, &ret); err != nil { + return r, w, err + } + w, err = item.writeResultJSON(newTypeNames, short, w, ret) + return r, w, err +} + +func (item *Service5InsertList) ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) { + var ret ListService5Output + err := item.ReadResultJSON(true, &basictl.JsonLexer{Data: r}, &ret) + if err != nil { + return r, w, err + } + w, err = item.WriteResult(w, ret) + return r, w, err +} + +func (item Service5InsertList) String() string { + return string(item.WriteJSON(nil)) +} + +func (item *Service5InsertList) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error { + var propFlagsPresented bool + var trueTypePersistentPresented bool + var trueTypePersistentValue bool + + if in != nil { + in.Delim('{') + if !in.Ok() { + return in.Error() + } + for !in.IsDelim('}') { + key := in.UnsafeFieldName(true) + in.WantColon() + switch key { + case "flags": + if propFlagsPresented { + return ErrorInvalidJSONWithDuplicatingKeys("service5.insertList", "flags") + } + if err := Json2ReadUint32(in, &item.Flags); err != nil { + return err + } + propFlagsPresented = true + case "persistent": + if trueTypePersistentPresented { + return ErrorInvalidJSONWithDuplicatingKeys("service5.insertList", "persistent") + } + if err := Json2ReadBool(in, &trueTypePersistentValue); err != nil { + return err + } + trueTypePersistentPresented = true + default: + return ErrorInvalidJSONExcessElement("service5.insertList", key) + } + in.WantComma() + } + in.Delim('}') + if !in.Ok() { + return in.Error() + } + } + if !propFlagsPresented { + item.Flags = 0 + } + if trueTypePersistentPresented { + if trueTypePersistentValue { + item.Flags |= 1 << 0 + } + } + // tries to set bit to zero if it is 1 + if trueTypePersistentPresented && !trueTypePersistentValue && (item.Flags&(1<<0) != 0) { + return ErrorInvalidJSON("service5.insertList", "fieldmask bit flags.0 is indefinite because of the contradictions in values") + } + return nil +} + +// This method is general version of WriteJSON, use it instead! +func (item *Service5InsertList) WriteJSONGeneral(w []byte) (_ []byte, err error) { + return item.WriteJSONOpt(true, false, w), nil +} + +func (item *Service5InsertList) WriteJSON(w []byte) []byte { + return item.WriteJSONOpt(true, false, w) +} +func (item *Service5InsertList) WriteJSONOpt(newTypeNames bool, short bool, w []byte) []byte { + w = append(w, '{') + backupIndexFlags := len(w) + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"flags":`...) + w = basictl.JSONWriteUint32(w, item.Flags) + if (item.Flags != 0) == false { + w = w[:backupIndexFlags] + } + if item.Flags&(1<<0) != 0 { + w = basictl.JSONAddCommaIfNeeded(w) + w = append(w, `"persistent":true`...) + } + return append(w, '}') +} + +func (item *Service5InsertList) MarshalJSON() ([]byte, error) { + return item.WriteJSON(nil), nil +} + +func (item *Service5InsertList) UnmarshalJSON(b []byte) error { + if err := item.ReadJSON(true, &basictl.JsonLexer{Data: b}); err != nil { + return ErrorInvalidJSON("service5.insertList", err.Error()) + } + return nil +} diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go index 52d2cdab..e36a79dd 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/meta/meta.go @@ -133,7 +133,8 @@ type TLItem struct { annotations uint32 tlName string - resultTypeContainsUnionTypes bool + resultTypeContainsUnionTypes bool + argumentsTypesContainUnionTypes bool createFunction func() Function createFunctionLong func() Function @@ -149,7 +150,8 @@ func (item TLItem) CreateObject() Object { return item.createObject() } func (item TLItem) IsFunction() bool { return item.createFunction != nil } func (item TLItem) CreateFunction() Function { return item.createFunction() } -func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInResult() bool { return item.resultTypeContainsUnionTypes } +func (item TLItem) HasUnionTypesInArguments() bool { return item.argumentsTypesContainUnionTypes } // For transcoding short-long version during Long ID transition func (item TLItem) HasFunctionLong() bool { return item.createFunctionLong != nil } @@ -303,107 +305,110 @@ func fillFunction(n1 string, n2 string, item *TLItem) { } func init() { - fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue", resultTypeContainsUnionTypes: false}) - fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color", resultTypeContainsUnionTypes: false}) - fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green", resultTypeContainsUnionTypes: false}) - fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red", resultTypeContainsUnionTypes: false}) - fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2", resultTypeContainsUnionTypes: false}) - fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false}) - fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8", resultTypeContainsUnionTypes: false}) - fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9", resultTypeContainsUnionTypes: false}) - fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code", resultTypeContainsUnionTypes: false}) - fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany", resultTypeContainsUnionTypes: false}) - fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne", resultTypeContainsUnionTypes: false}) - fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty", resultTypeContainsUnionTypes: false}) - fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType", resultTypeContainsUnionTypes: false}) - fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe", resultTypeContainsUnionTypes: false}) - fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1", resultTypeContainsUnionTypes: false}) - fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC", resultTypeContainsUnionTypes: false}) - fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD", resultTypeContainsUnionTypes: false}) - fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle", resultTypeContainsUnionTypes: false}) - fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString", resultTypeContainsUnionTypes: false}) - fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA", resultTypeContainsUnionTypes: false}) - fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red", resultTypeContainsUnionTypes: false}) - fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1", resultTypeContainsUnionTypes: false}) - fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2", resultTypeContainsUnionTypes: false}) - fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3", resultTypeContainsUnionTypes: false}) - fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4", resultTypeContainsUnionTypes: false}) - fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5", resultTypeContainsUnionTypes: false}) - fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6", resultTypeContainsUnionTypes: false}) - fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7", resultTypeContainsUnionTypes: false}) - fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8", resultTypeContainsUnionTypes: false}) - fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9", resultTypeContainsUnionTypes: false}) - fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType", resultTypeContainsUnionTypes: false}) - fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response", resultTypeContainsUnionTypes: false}) - fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC", resultTypeContainsUnionTypes: false}) - fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD", resultTypeContainsUnionTypes: false}) - fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle", resultTypeContainsUnionTypes: false}) - fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle", resultTypeContainsUnionTypes: false}) - fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle", resultTypeContainsUnionTypes: false}) - fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle", resultTypeContainsUnionTypes: false}) - fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple", resultTypeContainsUnionTypes: false}) - fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr", resultTypeContainsUnionTypes: false}) - fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren", resultTypeContainsUnionTypes: false}) - fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false}) - fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false}) - fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false}) - fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false}) - fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1", resultTypeContainsUnionTypes: false}) - fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint", resultTypeContainsUnionTypes: false}) - fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32", resultTypeContainsUnionTypes: false}) - fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64", resultTypeContainsUnionTypes: false}) - fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat", resultTypeContainsUnionTypes: false}) - fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus", resultTypeContainsUnionTypes: false}) - fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3", resultTypeContainsUnionTypes: false}) - fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero", resultTypeContainsUnionTypes: false}) - fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3", resultTypeContainsUnionTypes: false}) - fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers", resultTypeContainsUnionTypes: false}) - fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr", resultTypeContainsUnionTypes: false}) - fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace", resultTypeContainsUnionTypes: false}) - fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10", resultTypeContainsUnionTypes: false}) - fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12", resultTypeContainsUnionTypes: false}) - fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15", resultTypeContainsUnionTypes: false}) - fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17", resultTypeContainsUnionTypes: false}) - fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18", resultTypeContainsUnionTypes: false}) - fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2", resultTypeContainsUnionTypes: false}) - fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3", resultTypeContainsUnionTypes: false}) - fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5", resultTypeContainsUnionTypes: false}) - fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6", resultTypeContainsUnionTypes: false}) - fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7", resultTypeContainsUnionTypes: false}) - fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false}) - fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false}) - fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false}) - fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: false}) - fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false}) - fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: false}) - fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false}) - fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false}) - fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false}) - fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe", resultTypeContainsUnionTypes: false}) - fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2", resultTypeContainsUnionTypes: false}) - fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false}) - fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA", resultTypeContainsUnionTypes: false}) - fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB", resultTypeContainsUnionTypes: false}) - fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC", resultTypeContainsUnionTypes: false}) - fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD", resultTypeContainsUnionTypes: false}) - fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse", resultTypeContainsUnionTypes: false}) - fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly", resultTypeContainsUnionTypes: false}) - fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse", resultTypeContainsUnionTypes: false}) - fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr", resultTypeContainsUnionTypes: false}) - fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue", resultTypeContainsUnionTypes: false}) - fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity", resultTypeContainsUnionTypes: false}) + fillObject("a.blue#623360f3", "#623360f3", &TLItem{tag: 0x623360f3, annotations: 0x0, tlName: "a.blue", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.color#f35d7a69", "#f35d7a69", &TLItem{tag: 0xf35d7a69, annotations: 0x0, tlName: "a.color", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.green#6127e7b8", "#6127e7b8", &TLItem{tag: 0x6127e7b8, annotations: 0x0, tlName: "a.green", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.red#b83a723d", "#b83a723d", &TLItem{tag: 0xb83a723d, annotations: 0x0, tlName: "a.red", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.top2#7082d18f", "#7082d18f", &TLItem{tag: 0x7082d18f, annotations: 0x0, tlName: "a.top2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("a.uNionA#a7662843", "#a7662843", &TLItem{tag: 0xa7662843, annotations: 0x0, tlName: "a.uNionA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.alias#944aaa97", "#944aaa97", &TLItem{tag: 0x944aaa97, annotations: 0x0, tlName: "ab.alias", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call1#20c5fb2d", "#20c5fb2d", &TLItem{tag: 0x20c5fb2d, annotations: 0x1, tlName: "ab.call1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call10#8db2a4f8", "#8db2a4f8", &TLItem{tag: 0x8db2a4f8, annotations: 0x1, tlName: "ab.call10", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call11#ecb2a36c", "#ecb2a36c", &TLItem{tag: 0xecb2a36c, annotations: 0x1, tlName: "ab.call11", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: true}) + fillFunction("ab.call2#77d5f057", "#77d5f057", &TLItem{tag: 0x77d5f057, annotations: 0x1, tlName: "ab.call2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call3#0a083445", "#0a083445", &TLItem{tag: 0x0a083445, annotations: 0x1, tlName: "ab.call3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call4#c1220a1e", "#c1220a1e", &TLItem{tag: 0xc1220a1e, annotations: 0x1, tlName: "ab.call4", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call5#7ba4d28d", "#7ba4d28d", &TLItem{tag: 0x7ba4d28d, annotations: 0x1, tlName: "ab.call5", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call6#84d815cb", "#84d815cb", &TLItem{tag: 0x84d815cb, annotations: 0x1, tlName: "ab.call6", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call7#46ec10bf", "#46ec10bf", &TLItem{tag: 0x46ec10bf, annotations: 0x1, tlName: "ab.call7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call8#1b8652d9", "#1b8652d9", &TLItem{tag: 0x1b8652d9, annotations: 0x1, tlName: "ab.call8", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("ab.call9#75de906c", "#75de906c", &TLItem{tag: 0x75de906c, annotations: 0x1, tlName: "ab.call9", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.code#7651b1ac", "#7651b1ac", &TLItem{tag: 0x7651b1ac, annotations: 0x0, tlName: "ab.code", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsMany#14a35d80", "#14a35d80", &TLItem{tag: 0x14a35d80, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsMany", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.counterChangeRequestPeriodsOne#d9c36de5", "#d9c36de5", &TLItem{tag: 0xd9c36de5, annotations: 0x0, tlName: "ab.counterChangeRequestPeriodsOne", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.empty#1ec6a63e", "#1ec6a63e", &TLItem{tag: 0x1ec6a63e, annotations: 0x0, tlName: "ab.empty", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.myType#e0e96c86", "#e0e96c86", &TLItem{tag: 0xe0e96c86, annotations: 0x0, tlName: "ab.myType", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.testMaybe#4dac492a", "#4dac492a", &TLItem{tag: 0x4dac492a, annotations: 0x0, tlName: "ab.testMaybe", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.topLevel1#e67bce28", "#e67bce28", &TLItem{tag: 0xe67bce28, annotations: 0x0, tlName: "ab.topLevel1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.topLevel2#cef933fb", "#cef933fb", &TLItem{tag: 0xcef933fb, annotations: 0x0, tlName: "ab.topLevel2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeA#a99fef6a", "#a99fef6a", &TLItem{tag: 0xa99fef6a, annotations: 0x0, tlName: "ab.typeA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeB#ff2e6d58", "#ff2e6d58", &TLItem{tag: 0xff2e6d58, annotations: 0x0, tlName: "ab.typeB", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeC#69920d6e", "#69920d6e", &TLItem{tag: 0x69920d6e, annotations: 0x0, tlName: "ab.typeC", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.typeD#76615bf1", "#76615bf1", &TLItem{tag: 0x76615bf1, annotations: 0x0, tlName: "ab.typeD", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.useCycle#71687381", "#71687381", &TLItem{tag: 0x71687381, annotations: 0x0, tlName: "ab.useCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("ab.useDictString#3325d884", "#3325d884", &TLItem{tag: 0x3325d884, annotations: 0x0, tlName: "ab.useDictString", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("au.nionA#df61f632", "#df61f632", &TLItem{tag: 0xdf61f632, annotations: 0x0, tlName: "au.nionA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("b.red#a9471844", "#a9471844", &TLItem{tag: 0xa9471844, annotations: 0x0, tlName: "b.red", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call1#a7302fbc", "#a7302fbc", &TLItem{tag: 0xa7302fbc, annotations: 0x1, tlName: "call1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call2#f02024c6", "#f02024c6", &TLItem{tag: 0xf02024c6, annotations: 0x1, tlName: "call2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call3#6ace6718", "#6ace6718", &TLItem{tag: 0x6ace6718, annotations: 0x1, tlName: "call3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call4#46d7de8f", "#46d7de8f", &TLItem{tag: 0x46d7de8f, annotations: 0x1, tlName: "call4", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call5#fc51061c", "#fc51061c", &TLItem{tag: 0xfc51061c, annotations: 0x1, tlName: "call5", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call6#e41e4696", "#e41e4696", &TLItem{tag: 0xe41e4696, annotations: 0x1, tlName: "call6", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call7#262a43e2", "#262a43e2", &TLItem{tag: 0x262a43e2, annotations: 0x1, tlName: "call7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call8#7b400184", "#7b400184", &TLItem{tag: 0x7b400184, annotations: 0x1, tlName: "call8", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("call9#67a0d62d", "#67a0d62d", &TLItem{tag: 0x67a0d62d, annotations: 0x1, tlName: "call9", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.myType#eab6a6b4", "#eab6a6b4", &TLItem{tag: 0xeab6a6b4, annotations: 0x0, tlName: "cd.myType", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.response#8c202f64", "#8c202f64", &TLItem{tag: 0x8c202f64, annotations: 0x0, tlName: "cd.response", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.topLevel3#5cd1ca89", "#5cd1ca89", &TLItem{tag: 0x5cd1ca89, annotations: 0x0, tlName: "cd.topLevel3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeA#a831a920", "#a831a920", &TLItem{tag: 0xa831a920, annotations: 0x0, tlName: "cd.typeA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeB#377b4996", "#377b4996", &TLItem{tag: 0x377b4996, annotations: 0x0, tlName: "cd.typeB", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeC#db0f93d4", "#db0f93d4", &TLItem{tag: 0xdb0f93d4, annotations: 0x0, tlName: "cd.typeC", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.typeD#b5528285", "#b5528285", &TLItem{tag: 0xb5528285, annotations: 0x0, tlName: "cd.typeD", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cd.useCycle#6ed67ca0", "#6ed67ca0", &TLItem{tag: 0x6ed67ca0, annotations: 0x0, tlName: "cd.useCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cyc1.myCycle#136ecc9e", "#136ecc9e", &TLItem{tag: 0x136ecc9e, annotations: 0x0, tlName: "cyc1.myCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cyc2.myCycle#fba5eecb", "#fba5eecb", &TLItem{tag: 0xfba5eecb, annotations: 0x0, tlName: "cyc2.myCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cyc3.myCycle#47866860", "#47866860", &TLItem{tag: 0x47866860, annotations: 0x0, tlName: "cyc3.myCycle", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("cycleTuple#c867fae3", "#c867fae3", &TLItem{tag: 0xc867fae3, annotations: 0x0, tlName: "cycleTuple", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("halfStr#647ddaf5", "#647ddaf5", &TLItem{tag: 0x647ddaf5, annotations: 0x0, tlName: "halfStr", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("hren#12ab5219", "#12ab5219", &TLItem{tag: 0x12ab5219, annotations: 0x0, tlName: "hren", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int#a8509bda", "#a8509bda", &TLItem{tag: 0xa8509bda, annotations: 0x0, tlName: "int", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int32#7934e71f", "#7934e71f", &TLItem{tag: 0x7934e71f, annotations: 0x0, tlName: "int32", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("int64#f5609de0", "#f5609de0", &TLItem{tag: 0xf5609de0, annotations: 0x0, tlName: "int64", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("long#22076cba", "#22076cba", &TLItem{tag: 0x22076cba, annotations: 0x0, tlName: "long", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("maybeTest1#c457763c", "#c457763c", &TLItem{tag: 0xc457763c, annotations: 0x0, tlName: "maybeTest1", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("multiPoint#0e1ae81e", "#0e1ae81e", &TLItem{tag: 0x0e1ae81e, annotations: 0x0, tlName: "multiPoint", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myInt32#ba59e151", "#ba59e151", &TLItem{tag: 0xba59e151, annotations: 0x0, tlName: "myInt32", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myInt64#1d95db9d", "#1d95db9d", &TLItem{tag: 0x1d95db9d, annotations: 0x0, tlName: "myInt64", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myNat#c60c1b41", "#c60c1b41", &TLItem{tag: 0xc60c1b41, annotations: 0x0, tlName: "myNat", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myPlus#79e0c6df", "#79e0c6df", &TLItem{tag: 0x79e0c6df, annotations: 0x0, tlName: "myPlus", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myPlus3#692c291b", "#692c291b", &TLItem{tag: 0x692c291b, annotations: 0x0, tlName: "myPlus3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myZero#8d868379", "#8d868379", &TLItem{tag: 0x8d868379, annotations: 0x0, tlName: "myZero", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("myZero3#103a40cf", "#103a40cf", &TLItem{tag: 0x103a40cf, annotations: 0x0, tlName: "myZero3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("nativeWrappers#344ddf50", "#344ddf50", &TLItem{tag: 0x344ddf50, annotations: 0x0, tlName: "nativeWrappers", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("noStr#3a728324", "#3a728324", &TLItem{tag: 0x3a728324, annotations: 0x0, tlName: "noStr", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace#323db63e", "#323db63e", &TLItem{tag: 0x323db63e, annotations: 0x0, tlName: "replace", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace10#fc81f008", "#fc81f008", &TLItem{tag: 0xfc81f008, annotations: 0x0, tlName: "replace10", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace12#ec121094", "#ec121094", &TLItem{tag: 0xec121094, annotations: 0x0, tlName: "replace12", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace15#2280e430", "#2280e430", &TLItem{tag: 0x2280e430, annotations: 0x0, tlName: "replace15", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace17#f46f9b9b", "#f46f9b9b", &TLItem{tag: 0xf46f9b9b, annotations: 0x0, tlName: "replace17", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace18#704dd712", "#704dd712", &TLItem{tag: 0x704dd712, annotations: 0x0, tlName: "replace18", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace2#e2d4ebee", "#e2d4ebee", &TLItem{tag: 0xe2d4ebee, annotations: 0x0, tlName: "replace2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace3#51e324e4", "#51e324e4", &TLItem{tag: 0x51e324e4, annotations: 0x0, tlName: "replace3", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace5#8b5bc78a", "#8b5bc78a", &TLItem{tag: 0x8b5bc78a, annotations: 0x0, tlName: "replace5", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace6#abd49d06", "#abd49d06", &TLItem{tag: 0xabd49d06, annotations: 0x0, tlName: "replace6", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace7#f4c66d9f", "#f4c66d9f", &TLItem{tag: 0xf4c66d9f, annotations: 0x0, tlName: "replace7", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace8#d626c117", "#d626c117", &TLItem{tag: 0xd626c117, annotations: 0x0, tlName: "replace8", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("replace9#95d598c5", "#95d598c5", &TLItem{tag: 0x95d598c5, annotations: 0x0, tlName: "replace9", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("service5.emptyOutput#ff8f7db8", "#ff8f7db8", &TLItem{tag: 0xff8f7db8, annotations: 0x0, tlName: "service5.emptyOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("service5.insert#7cf362ba", "#7cf362ba", &TLItem{tag: 0x7cf362ba, annotations: 0x2, tlName: "service5.insert", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillFunction("service5.insertList#7cf362bc", "#7cf362bc", &TLItem{tag: 0x7cf362bc, annotations: 0x2, tlName: "service5.insertList", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillObject("service5Long.emptyOutput#ff8f7db9", "#ff8f7db9", &TLItem{tag: 0xff8f7db9, annotations: 0x0, tlName: "service5Long.emptyOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("service5Long.insert#7cf362bb", "#7cf362bb", &TLItem{tag: 0x7cf362bb, annotations: 0x2, tlName: "service5Long.insert", resultTypeContainsUnionTypes: true, argumentsTypesContainUnionTypes: false}) + fillObject("service5Long.stringOutput#dc170ff5", "#dc170ff5", &TLItem{tag: 0xdc170ff5, annotations: 0x0, tlName: "service5Long.stringOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("service5.stringOutput#dc170ff4", "#dc170ff4", &TLItem{tag: 0xdc170ff4, annotations: 0x0, tlName: "service5.stringOutput", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("string#b5286e24", "#b5286e24", &TLItem{tag: 0xb5286e24, annotations: 0x0, tlName: "string", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("testMaybe#88920e90", "#88920e90", &TLItem{tag: 0x88920e90, annotations: 0x0, tlName: "testMaybe", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("testMaybe2#0aa03cf2", "#0aa03cf2", &TLItem{tag: 0x0aa03cf2, annotations: 0x0, tlName: "testMaybe2", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("true#3fedd339", "#3fedd339", &TLItem{tag: 0x3fedd339, annotations: 0x0, tlName: "true", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeA#157673c1", "#157673c1", &TLItem{tag: 0x157673c1, annotations: 0x0, tlName: "typeA", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeB#9d024802", "#9d024802", &TLItem{tag: 0x9d024802, annotations: 0x0, tlName: "typeB", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeC#6b8ef43f", "#6b8ef43f", &TLItem{tag: 0x6b8ef43f, annotations: 0x0, tlName: "typeC", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("typeD#b1f4369e", "#b1f4369e", &TLItem{tag: 0xb1f4369e, annotations: 0x0, tlName: "typeD", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("unionArgsUse#742161d2", "#742161d2", &TLItem{tag: 0x742161d2, annotations: 0x0, tlName: "unionArgsUse", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useDictUgly#fb9ce817", "#fb9ce817", &TLItem{tag: 0xfb9ce817, annotations: 0x0, tlName: "useDictUgly", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useResponse#0a63ec5f", "#0a63ec5f", &TLItem{tag: 0x0a63ec5f, annotations: 0x0, tlName: "useResponse", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useStr#9aa3dee5", "#9aa3dee5", &TLItem{tag: 0x9aa3dee5, annotations: 0x0, tlName: "useStr", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillObject("useTrue#dfdd4180", "#dfdd4180", &TLItem{tag: 0xdfdd4180, annotations: 0x0, tlName: "useTrue", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) + fillFunction("usefulService.getUserEntity#3c857e52", "#3c857e52", &TLItem{tag: 0x3c857e52, annotations: 0x2, tlName: "usefulService.getUserEntity", resultTypeContainsUnionTypes: false, argumentsTypesContainUnionTypes: false}) } diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/tl/tl.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/tl/tl.go index 1afc6780..73907a4b 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/tl/tl.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/tl/tl.go @@ -50,6 +50,7 @@ type ( Int64 = internal.Int64 IntBoxedMaybe = internal.IntBoxedMaybe IntMaybe = internal.IntMaybe + ListService5Output = internal.ListService5Output Long = internal.Long MaybeTest1 = internal.MaybeTest1 MaybeWrapperInt3 = internal.MaybeWrapperInt3 diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/tlab/tlab.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/tlab/tlab.go index 930b4849..77463c2b 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/tlab/tlab.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/tlab/tlab.go @@ -14,6 +14,8 @@ import ( type ( Alias = internal.AbAlias Call1 = internal.AbCall1 + Call10 = internal.AbCall10 + Call11 = internal.AbCall11 Call2 = internal.AbCall2 Call3 = internal.AbCall3 Call4 = internal.AbCall4 diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/tljson.html b/internal/tlcodegen/test/gen/goldmaster_nosplit/tljson.html index 4947b156..d0ffeacc 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/tljson.html +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/tljson.html @@ -21,6 +21,16 @@

    Functions

    ab.call1ab.TypeB
  • +
  • + + ab.call10 + → a.Color +
  • +
  • + + ab.call11 + → a.Color +
  • ab.call2 @@ -111,6 +121,11 @@

    Functions

    service5.insertservice5.Output
  • +
  • + + service5.insertList + → List<service5.Output> +
  • service5Long.insert @@ -411,6 +426,46 @@

    ab.call1

    +

    ab.call10

    + +

    + Returns a.Color +
    +
    JSON
    +
    + {} +
    +
    TL
    +
    + read ab.call10#8db2a4f8 = a.Color; +
    +
    + +

    ab.call11

    + +

    + Returns a.Color +
    +
    JSON
    +
    + { + + + + + + + +
      "x": a.Color +
    + } +
    +
    TL
    +
    + read ab.call11#ecb2a36c x:a.Color = a.Color; +
    +
    +

    ab.call2

    @@ -2399,6 +2454,47 @@

    Maybe<int>

    +

    list<service5.Output>

    + //---- test recursive struct without union as result
    + +

    +
    +
    JSON
    +
    + { + + + + + + + + + + + + + + + + + + + +
      "flag": <uint32>, +
      "head": service5.Output,// flag bit #0 + +
      "tail": list<service5.Output>// flag bit #0 + +
    + } +
    +
    TL
    +
    + list#02d80cdd {X:Type} flag:# head:flag.0?X tail:flag.0?(list X) = List X; +
    +
    +

    maybeTest1

    @@ -4092,6 +4188,39 @@

    service5.insert

    +

    service5.insertList

    + +

    + Returns List<service5.Output> +
    +
    JSON
    +
    + { + + + + + + + + + + + + + +
      "flags": <uint32>, +
      "persistent": true// flags bit #0 + +
    + } +
    +
    TL
    +
    + readwrite service5.insertList#7cf362bc flags:# persistent:flags.0?%True = (List service5.Output); +
    +
    +

    service5Long.insert

    diff --git a/internal/tlcodegen/test/gen/goldmaster_nosplit/tlservice5/tlservice5.go b/internal/tlcodegen/test/gen/goldmaster_nosplit/tlservice5/tlservice5.go index 5ad34f48..53af6873 100644 --- a/internal/tlcodegen/test/gen/goldmaster_nosplit/tlservice5/tlservice5.go +++ b/internal/tlcodegen/test/gen/goldmaster_nosplit/tlservice5/tlservice5.go @@ -14,6 +14,7 @@ import ( type ( EmptyOutput = internal.Service5EmptyOutput Insert = internal.Service5Insert + InsertList = internal.Service5InsertList Output = internal.Service5Output StringOutput = internal.Service5StringOutput )