Skip to content

Commit e13bf16

Browse files
committed
Review response: Defined "inline erasure" and used it to simplify the new error
1 parent 15b5cbf commit e13bf16

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

accepted/future-releases/inline-classes/feature-specification.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -761,18 +761,24 @@ representation dependency on itself.
761761
always possible to find a non-inline type which is the ultimate
762762
representation type of any given inline type.*
763763

764+
The *inline erasure* of an inline type `V` is obtained by recursively
765+
replacing every subterm of `V` which is an inline type by the
766+
corresponding representation type.
767+
768+
*Note that this inline erasure exists, because it is a compile-time
769+
error to have a dependency cycle among inline types.*
770+
764771
Let
765772
<code>X<sub>1</sub> extends B<sub>1</sub>, .. X<sub>s</sub> extends B<sub>s</sub></code>
766773
be a declaration of the type parameters of a generic entity (*it could
767774
be a generic class, inline or not, or mixin, or typedef, or function*).
768-
Let <code>BB<sub>j</sub></code> be the result of recursively
769-
replacing every inline type that occurs in <code>B<sub>j</sub></code>,
770-
for _j_ in _1 .. s_.
775+
Let <code>BB<sub>j</sub></code> be the inline erasure of
776+
<code>B<sub>j</sub></code>, for _j_ in _1 .. s_.
771777
It is a compile-time error if
772778
<code>X<sub>1</sub> extends BB<sub>1</sub>, .. X<sub>s</sub> extends BB<sub>s</sub></code>
773779
has any compile-time errors.
774780

775-
*For example, this erasure step could map
781+
*For example, the inline erasure could map
776782
<code>X extends C<Y>, Y extends X</code> to
777783
<code>X extends Y, Y extends X</code>,
778784
which is an error.*

0 commit comments

Comments
 (0)