@@ -852,28 +852,36 @@ preserve the name and the modifier `required`, if any. An optional
852852positional or named parameter remains optional; if it has a default value
853853` d ` in _ L_ then it has the default value ` d ` in _ L2_ as well.
854854
855+ If _ D_ is an extension type declaration, then it's an error if
856+ _ L_ does not have a single formal parameter (positional or named),
857+ or if that parameter does not have the form ` T p ` or ` final T p `
858+ where ` T ` is a type and ` p ` is an identifier.
859+ _ It's an error if the parameter declaration uses ` var ` or has a
860+ ` covariant ` modifier._
861+ The parameter is replaced by ` this.p ` in _ L2_ .
862+ The extension type has a representation type of ` T ` and
863+ a representation value getter with signature ` T get p; ` .
864+
865+ Otherwise _ D_ is a class, mixin class or enum declaration:
855866- An initializing formal parameter * (e.g., ` T this.x ` )* is copied from _ L_
856867 to _ L2_ , with no changes.
857868- A super parameter is copied from _ L_ to _ L2_ any, with no changes.
858869- A formal parameter which is not covered by the previous two cases and
859- which does not have the modifier ` var ` or the modifier ` final ` is copied
860- unchanged from _ L_ to _ L2_ * (this is a plain, non-declaring parameter)* .
861- - Otherwise, it is a declaring parameter. A formal parameter (named or
862- positional) of the form ` var T p ` or ` final T p ` where ` T ` is a type and
863- ` p ` is an identifier is replaced in _ L2_ by ` this.p ` , along with its
864- default value, if any. The same is done in the case where the formal
865- parameter has the form ` var p ` or ` final p ` , and ` T ` is the declared type
866- of ` p ` which was obtained by inference. If the parameter has the modifier
867- ` var ` and _ D_ is an extension type declaration then a compile-time error
868- occurs. Otherwise, if _ D_ is not an extension type declaration, a
869- semantic instance variable declaration corresponding to the syntax ` T p; `
870- or ` final T p; ` is added to _ D2_ . It includes the modifier ` final ` if and
871- only if the parameter in _ L_ has the modifier ` final ` and _ D_ is not an
872- ` extension type ` decaration. Otherwise, if _ D_ is an ` extension type `
873- declaration then the name of ` p ` specifies the name of the representation
874- variable. In all cases, if ` p ` has the modifier ` covariant ` then this
875- modifier is removed from the parameter in _ L2_ , and it is added to the
876- instance variable declaration named ` p ` .
870+ which does not have the modifier ` var ` or the modifier ` final ` ,
871+ is copied unchanged from _ L_ to _ L2_
872+ * (this is a plain, non-declaring parameter)* .
873+ - Otherwise, it is a declaring parameter, a formal parameter (named or positional)
874+ of the form ` final T p ` , ` final p ` , ` var T p ` or ` var p ` , the last two optionally
875+ prefixed by ` covariant ` , where ` T ` is a type and ` p ` is an identifier.
876+ It is replaced in _ L2_ by ` this.p ` , along with its default value, if any.
877+ Let ` T ` be the type of the formal parameter, whether declared explicitly
878+ or inferred.
879+ A semantic instance variable declaration corresponding to the syntax ` T p; ` ,
880+ ` covariant T p; ` or ` final T p; ` is added to _ D2_ .
881+ It includes the modifier ` final ` if and only if the parameter in _ L_ has
882+ the modifier ` final ` . It includes the ` covariant ` modifier if the
883+ parameter in _ L_ has the modifier ` covariant ` , or if the instance variable
884+ overrides an instance setter with a covariant parameter, and otherwise not.
877885
878886If there is a primary constructor body part that contains an initializer
879887list then _ k2_ has an initializer list with the same elements in the same
0 commit comments