Skip to content

Commit 3186b03

Browse files
committed
Mirror generation error section in docs
1 parent 09d9a24 commit 3186b03

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/_docs/reference/contextual/derivation.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ new Mirror.Product:
119119
new Leaf(...)
120120
```
121121

122+
If a Mirror cannot be generated automatically for a given type, an error will appear explaining why it is neither a supported
123+
sum type nor a product type. For example, if `A` is a trait that is not sealed,
124+
125+
```
126+
No given instance of type deriving.Mirror.Of[A] was found for parameter x of method summon in object Predef. Failed to synthesize an instance of type deriving.Mirror.Of[A]:
127+
* trait A is not a generic product because it is not a case class
128+
* trait A is not a generic sum because it is not a sealed trait
129+
```
130+
131+
122132
Note the following properties of `Mirror` types,
123133

124134
+ Properties are encoded using types rather than terms. This means that they have no runtime footprint unless used and

0 commit comments

Comments
 (0)