Skip to content

Commit eda2cd4

Browse files
committed
Validation
1 parent d1d97ec commit eda2cd4

4 files changed

Lines changed: 25 additions & 22 deletions

File tree

src/TL_file_ref_map_schema.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@
8686
],
8787
"type": "TraverseParam"
8888
},
89+
{
90+
"id": "-39194058",
91+
"predicate": "traverseMethodResult",
92+
"params": [
93+
{
94+
"name": "name",
95+
"type": "string"
96+
},
97+
{
98+
"name": "push_sources",
99+
"type": "Vector<Source>"
100+
},
101+
{
102+
"name": "is_needed_parent",
103+
"type": "Bool"
104+
}
105+
],
106+
"type": "TraverserIncoming"
107+
},
89108
{
90109
"id": "1850540214",
91110
"predicate": "traverseIncomingConstructor",
@@ -136,25 +155,6 @@
136155
],
137156
"type": "TraverserIncoming"
138157
},
139-
{
140-
"id": "-39194058",
141-
"predicate": "traverseMethodResult",
142-
"params": [
143-
{
144-
"name": "name",
145-
"type": "string"
146-
},
147-
{
148-
"name": "push_sources",
149-
"type": "Vector<Source>"
150-
},
151-
{
152-
"name": "is_needed_parent",
153-
"type": "Bool"
154-
}
155-
],
156-
"type": "TraverserIncoming"
157-
},
158158
{
159159
"id": "-584595818",
160160
"predicate": "source",

src/TL_file_ref_map_schema.tl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ fileReferenceMap#72a99250 layer:int db_schema:string db_schema_json:string trave
1010
// Traversers (incoming)
1111
traverseParam#62161b67 flags:# name:string is_flag:flags.0?true is_vector:flags.1?true type:string = TraverseParam;
1212

13+
traverseMethodResult#fda9f236 name:string push_sources:Vector<Source> is_needed_parent:Bool = TraverserIncoming;
1314
traverseIncomingConstructor#6e4d00b6 type:string predicate:string params:Vector<TraverseParam> push_sources:Vector<Source> is_needed_parent:Bool = TraverserIncoming;
1415
traverseCommitSourceLocation#94cc59c5 type:string predicate:string push_sources:Vector<Source> stored_constructor:string = TraverserIncoming;
15-
traverseMethodResult#fda9f236 name:string push_sources:Vector<Source> is_needed_parent:Bool = TraverserIncoming;
1616

1717
source#dd27c696 flags:# predicate:string is_constructor:flags.0?true stored_constructor:string stored_params:Vector<FieldExtractor> skipped_flags:Vector<string> needs_parent:flags.3?string parent_is_constructor:flags.4?true = Source;
1818

tools/FileRefExtractor/FileRefGenerator.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,13 @@ public static function fixupTraversalPairs(Ast $output, TLWrapper $TL, array $lo
839839
Assert::false($hasReturn, "Constructor $cons has a return value, cannot be used in incoming traversal");
840840
Assert::notEmpty($newFields, "Constructor $cons does not have fields in traversal pairs but is used as a constructor");
841841

842+
$consT = $TL->getConstructorOrMethod($cons)['type'];
843+
Assert::notEq($consT, 'Updates', "Constructor $cons has type Updates, cannot be used in incoming traversal as it is not a message/container constructor");
844+
842845
$fixed[] = [
843846
'_' => 'traverseIncomingConstructor',
844847
'predicate' => $cons,
845-
'type' => $TL->getConstructorOrMethod($cons)['type'],
848+
'type' => $consT,
846849
'params' => $newFields,
847850
'push_sources' => $sources[$cons] ?? [],
848851
'is_needed_parent' => isset($parents[$cons]),

0 commit comments

Comments
 (0)