File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,6 @@ class TTypeParser
186
186
187
187
private:
188
188
TAstNode* ParseType () {
189
- bool isPgType = false ;
190
189
TAstNode* type = nullptr ;
191
190
192
191
switch (Token) {
@@ -324,13 +323,11 @@ class TTypeParser
324
323
if (id.SkipPrefix (" pg" )) {
325
324
if (NPg::HasType (TString (id))) {
326
325
type = MakePgType (id);
327
- isPgType = true ;
328
326
GetNextToken ();
329
327
}
330
328
} else if (id.SkipPrefix (" _pg" )) {
331
329
if (NPg::HasType (TString (id)) && !id.StartsWith (' _' )) {
332
330
type = MakePgType (TString (" _" ) + id);
333
- isPgType = true ;
334
331
GetNextToken ();
335
332
}
336
333
}
@@ -342,10 +339,6 @@ class TTypeParser
342
339
343
340
if (type) {
344
341
while (Token == ' ?' ) {
345
- if (isPgType) {
346
- return AddError (TString (" PG type can't be wrapped into Optional type" ));
347
- }
348
-
349
342
type = MakeOptionalType (type);
350
343
GetNextToken ();
351
344
}
Original file line number Diff line number Diff line change @@ -678,4 +678,9 @@ Y_UNIT_TEST_SUITE(TTypeString)
678
678
TestFormat (" ((Pg int4))" , " pgint4" );
679
679
TestFormat (" ((Pg _int4))" , " _pgint4" );
680
680
}
681
+
682
+ Y_UNIT_TEST (FormatOptionalPg) {
683
+ TestFormat (" ((Optional (Pg int4)))" , " Optional<pgint4>" );
684
+ TestFormat (" ((Optional (Pg _int4)))" , " Optional<_pgint4>" );
685
+ }
681
686
}
You can’t perform that action at this time.
0 commit comments