Skip to content

Commit

Permalink
Update sealed oneofs no longer experimental.
Browse files Browse the repository at this point in the history
  • Loading branch information
thesamet committed Apr 25, 2021
1 parent 76660b2 commit 322f4b9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions docs/src/main/markdown/sealed-oneofs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
title: "Sealed oneofs"
---

**Note: sealed oneofs are available only in ScalaPB 0.8 or later. The API and rules are considered experimental. See note at the bottom. **

Sealed oneofs are a subset of oneofs for which ScalaPB generates idiomatic data types for.

## Example
Expand Down Expand Up @@ -83,8 +81,6 @@ A sealed oneof is detected when a message (denoted below as the *containing mess
7. Sealed oneofs and the fields within them can not be typemapped to custom
types.

## Experimental Status

Some of the rules above are inherently required (for example, that the message types need to be distinct). Other rules, such as the one requesting that all involved messages need to be inside the same namespace, were added to make the implementation simpler. That particular rule helps ensuring that all the cases can be generated into a single Scala source file without changing too much the existing way the code generator works. It is possible that some of the rules will change over time, though most likely they are only going to become less restrictive so existing code does not break.

Currently, sealed oneofs are implemented as a custom type defined over the old-style container message. This implementation detail is exposed through `asMessage` which returns the underlying message representing the sealed oneof. It is possible that in a future version, sealed oneofs would have a direct implementation, and therefore `asMessage` and its return type should be considered an experimental API.
Expand Down

0 comments on commit 322f4b9

Please sign in to comment.