forked from microsoft/bond
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXAMPLE: Buggy behavior when deserializing something with a base and …
…encountering BT_STOP during the base instead of BT_STOP_BASE
- Loading branch information
Showing
2 changed files
with
29 additions
and
100 deletions.
There are no files selected for viewing
28 changes: 3 additions & 25 deletions
28
examples/cpp/core/polymorphic_container/polymorphic_container.bond
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,12 @@ | ||
namespace examples.polymorphic_containers | ||
|
||
enum StructKind | ||
{ | ||
StructKind_Unknown; | ||
StructKind_Struct1; | ||
StructKind_Struct2; | ||
} | ||
|
||
struct Base | ||
{ | ||
0: StructKind kind = StructKind_Unknown; | ||
} | ||
|
||
|
||
struct Struct1 : Base | ||
{ | ||
0: string str; | ||
1: uint16 n; | ||
0: int32 f; | ||
} | ||
|
||
|
||
struct Struct2 : Base | ||
{ | ||
1: bool b; | ||
2: int32 n; | ||
3: string str; | ||
} | ||
|
||
|
||
struct Polymorphic | ||
struct Derived : Base | ||
{ | ||
0: list<bonded<Base>> items; | ||
0: int32 df; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters