Skip to content

Commit

Permalink
fix annotations for unions
Browse files Browse the repository at this point in the history
  • Loading branch information
pfuen authored and aisk committed Feb 8, 2024
1 parent fc26372 commit 5784039
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions tests/parser-cases/annotations.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ service foo_service {
void foo() ( foo = "bar" )
} (a.b="c")

union foo_union {
1: optional bool abc
2: optional i32 xyz
} (a.b="c")
2 changes: 1 addition & 1 deletion thriftpy2/parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def p_seen_struct(p):


def p_union(p):
'''union : seen_union '{' field_seq '}' '''
'''union : seen_union '{' field_seq '}' type_annotations'''
val = _fill_in_struct(p[1], p[3])
_add_thrift_meta('unions', val)

Expand Down

0 comments on commit 5784039

Please sign in to comment.