File tree 1 file changed +4
-0
lines changed
docs/docs/reference/contextual
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,10 @@ Note the following properties of `Mirror` types,
129
129
Scala 2 versions of shapeless). Instead the collection of child types of a data type is represented by an ordinary,
130
130
possibly parameterized, tuple type. Dotty's metaprogramming facilities can be used to work with these tuple types
131
131
as-is, and higher level libraries can be built on top of them.
132
+ + For both product and sum types, the elements of ` MirroredElemTypes ` are arranged in definition order (i.e. ` Branch[T] `
133
+ precedes ` Leaf[T] ` in ` MirroredElemTypes ` for ` Tree ` because ` Branch ` is defined before ` Leaf ` in the source file).
134
+ This means that ` Mirror.Sum ` differs in this respect from shapeless's generic representation for ADTs in Scala 2,
135
+ where the constructors are ordered alphabetically by name.
132
136
+ The methods ` ordinal ` and ` fromProduct ` are defined in terms of ` MirroredMonoType ` which is the type of kind-` * `
133
137
which is obtained from ` MirroredType ` by wildcarding its type parameters.
134
138
You can’t perform that action at this time.
0 commit comments