Skip to content

Commit 7bcc24a

Browse files
committed
Review response, eliminated most controversies
1 parent 1a0ecbd commit 7bcc24a

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

accepted/future-releases/extension-types/feature-specification.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ _not_ eliminated by the existence of other declarations (of any kind) named
723723
`_n` in the same library.
724724

725725
Conversely, the existence of an extension type with a representation
726-
variable with a private name `_n` does not eliminate promotion of
726+
variable with a private name `_n` does not eliminate promotion of
727727
any private instance variables named `_n` of a class, mixin, enum, or mixin
728728
class in the same library.
729729

@@ -1133,9 +1133,6 @@ Assume that _DV_ is an extension type declaration named `Name`, and
11331133
`V1` occurs as one of the `<type>`s in the `<interfaces>` of _DV_. In
11341134
this case we say that `V1` is a _superinterface_ of _DV_.
11351135

1136-
If _DV_ does not include an `<interfaces>` clause then _DV_ has
1137-
`Object?` as a direct superinterface.
1138-
11391136
A compile-time error occurs if `V1` is a type name or a parameterized type
11401137
which occurs as a superinterface in an extension type declaration _DV_, and
11411138
`V1` denotes a non-extension type which is not a supertype of the
@@ -1299,7 +1296,12 @@ rather than from `Object`)*.
12991296

13001297
*This change is needed because some extension types are subtypes of
13011298
`Object?` and not subtypes of `Object`, and they need to have a
1302-
well-defined depth.*
1299+
well-defined depth. We could define the depth to be zero for `Object`, for
1300+
`Null`, and for every extension type that has no `implements` clause, and
1301+
insist that `Object?` isn't an interface type and doesn't have a depth, but
1302+
in that case we no longer have a guarantee that the sets of superinterfaces
1303+
with the same maximal depth that the Dart 1 least upper bound algorithm
1304+
uses will have at least one singleton set.*
13031305

13041306

13051307
## Dynamic Semantics of Extension Types
@@ -1377,12 +1379,9 @@ relationships involving `V0`:*
13771379
- *`V0` is a proper subtype of each of `V1 .. Vk`.*
13781380
- *Let `R0` be the extension type erasure of `V0`. At run time, the type
13791381
`V0` has the same representation and semantics as `R0`. In particular,
1380-
`o is V0` and `o as V0` have the same dynamic semantics as `o is R0`
1381-
respectively `o as R0`. `t1 == t2` evaluates to true if `t1` is a
1382-
`Type` that reifies `V0` and `t2` reifies `R0`. Similarly, two types `t1`
1383-
and `t2` are equal if they are structurally equal except that `V0` occurs
1384-
in `t1` and `R0` occurs at the corresponding location in `t2`
1385-
(e.g., `List<V0>` is equal to `List<R0>`).*
1382+
they behave identically with respect to `is`, `is!`, `as`, and `==`,
1383+
both when `V0` and `R0` are used as types, and when they occur as
1384+
subterms of another type.
13861385

13871386

13881387
## Discussion

0 commit comments

Comments
 (0)