Skip to content

Commit a32697a

Browse files
committed
Trailing whitespace
1 parent 8dcb349 commit a32697a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

working/4213-generic-constructors/feature-specification.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ expressive than constructors in current Dart.
1616

1717
This document specifies generic constructors. This is a feature that
1818
supports the declaration of constructors whose treatment of type parameters
19-
is more flexible and expressive than constructors in current Dart.
19+
is more flexible and expressive than constructors in current Dart.
2020

2121
In particular, it allows the constructor to have type parameters that are
2222
not used in the return type (that is, the type of the newly created
@@ -165,16 +165,16 @@ class Map<K, V> {
165165
}
166166
```
167167

168-
However, that is a compile-time error because it returns a
168+
However, that is a compile-time error because it returns a
169169
`Map<Object?, List<Object?>>` where the return type is `Map<K, V>`.
170170
But we don't know `K` or `V`, and we can't assume that `V` is of the form
171171
`List<K>` or a supertype thereof. We might try to cast the map literal to
172-
`Map<K, V>`, and that might work, but an invocation like
172+
`Map<K, V>`, and that might work, but an invocation like
173173
`Map<int, String>.keyToList(xs)` will then throw at run time because the
174174
map literal isn't going to have the required type no matter which iterable
175175
we are passing as `keys`.
176176

177-
With the generic constructor and with an invocation like
177+
With the generic constructor and with an invocation like
178178
`Map<int, String>.keyToList(xs)`, the actual type arguments will be used as
179179
a context type for the constructor invocation. The generic constructor
180180
`Map.keyToList` fails to infer actual type arguments such that the
@@ -226,19 +226,19 @@ The grammar is adjusted as follows:
226226

227227
```ebnf
228228
<constructorSignature> ::= <constructorName> <formalParameterList>
229-
| <typeIdentifier> <typeArguments>? '.' <identifierOrNew>
229+
| <typeIdentifier> <typeArguments>? '.' <identifierOrNew>
230230
<typeParameters> <formalParameterList>
231-
| <typeIdentifier> <typeArguments> '.' <identifierOrNew>
231+
| <typeIdentifier> <typeArguments> '.' <identifierOrNew>
232232
<formalParameterList>
233233
234-
<factoryConstructorSignature> ::=
234+
<factoryConstructorSignature> ::=
235235
'const'? 'factory' <constructorSignature>
236236
237237
<redirectingFactoryConstructorSignature> ::=
238-
'const'? 'factory' <constructorSignature> '='
238+
'const'? 'factory' <constructorSignature> '='
239239
<constructorDesignation>
240240
241-
<constantConstructorSignature> ::=
241+
<constantConstructorSignature> ::=
242242
'const' <constructorSignature>
243243
```
244244

@@ -253,7 +253,7 @@ declaration.
253253

254254
### Static Analysis
255255

256-
A generic constructor declaration occurs as a member of a type introducing
256+
A generic constructor declaration occurs as a member of a type introducing
257257
declaration or an extension declaration. Its current scope is the body
258258
scope of the enclosing declaration. It introduces a type parameter scope
259259
whose enclosing scope is the current scope of the generic constructor
@@ -317,11 +317,11 @@ non-generic class).
317317
In this case, the super-initializer of the constructor (explicit or
318318
implicit, and excepting `Object` that does not have a super-initializer)
319319
will invoke the superconstructor with actual type arguments that correspond
320-
to the type `C<T1 .. Tk>` of the current constructor invocation.
320+
to the type `C<T1 .. Tk>` of the current constructor invocation.
321321

322322
That is, if `C` is declared with `k` type parameters `X1 .. Xk` and
323323
superclass `B<U1 .. Us>` then the `j`th actual type argument to the super
324-
constructor invocation is obtained as `[T1/X1 .. Tk/Xk]Uj`, for `j` in
324+
constructor invocation is obtained as `[T1/X1 .. Tk/Xk]Uj`, for `j` in
325325
`1 .. s`.
326326

327327
Moreover, in the body of _D_, the reserved word `this` has static type
@@ -359,7 +359,7 @@ whose constructor signature applies a list of actual type arguments to the
359359
`<typeIdentifier>`, of the form `C<T1 .. Tk>`. (This includes the case
360360
where `k` is zero, which again implies that `C` is a non-generic class).
361361

362-
In this case, the redirectee must have a type which is a subtype of
362+
In this case, the redirectee must have a type which is a subtype of
363363
`C<T1 .. Tk>`. Similarly, if the redirectee denotes a generic constructor
364364
and no actual type arguments are provided then `C<T1 .. Tk>` is used as the
365365
type to match when such type arguments are inferred.
@@ -396,7 +396,7 @@ inferred exactly like invocations of that static method.*
396396
Consider an invocation of this generic constructor of the form
397397
`C<S1 .. Sk>.name(args)`, with context type `T`. This invocation is
398398
subjected to type inference as if the generic constructor had been the same
399-
static method of `C` as in the previous case, but with context type
399+
static method of `C` as in the previous case, but with context type
400400
`C<S1 .. Sk>`.
401401

402402
Warnings are not language specified entities, but the following warning is

0 commit comments

Comments
 (0)