Skip to content

Commit 445aa27

Browse files
author
Sergey G. Grekhov
authored
Typos and compile errors in Enhanced Enums specification fixed (#2109)
* Typos and compile errors in Enhanced Enums specification fixed
1 parent 8a24ca8 commit 445aa27

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

accepted/future-releases/enhanced-enums/feature-specification.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ If the resulting class would have any naming conflicts, or other compile-time er
136136

137137
- Declaring or inheriting (from `Enum` or from a declared mixin or interface) any member with the same basename as an enum value which is not a static setter. _(The introduced static declarations would have a conflict.)_
138138
- Declaring or mixing in a member which is not a valid override of a super-interface member declaration, including, but not limited to, the `index` and `toString` members of `Enum`.
139-
- Declaring or inheriting an member signature with no corresponding implementation. _(For example declaring an abstract `Never get index` or `String toString([int optional])`, but not providing an implementation.)
139+
- Declaring or inheriting a member signature with no corresponding implementation. _(For example declaring an abstract `Never get index` or `String toString([int optional])`, but not providing an implementation.)_
140140
- Declaring a type parameter on the `enum` which does not have a valid well-bounded or super-bounded instantiate-to-bounds result *and* not declaring or inheriting a member with base-name `values` _(because the then automatically introduced `static const List<EnumName> values` requires a valid instantiate-to-bounds result which is at least super-bounded, and a value declaration may require a well-bounded instantiation)_.
141141
- The type parameters of the enum not having a well-bounded instantiate-to-bounds result *and* an enum element omitting the type arguments and not having arguments which valid type arguments can be inferred from (because an implicit `EnumName(0, "foo", unrelatedArgs)` constructor invocation requires a well-bound inferred type arguments for a generic `EnumName` enum).
142142
- Using a non-constant expression as argument of an enum value.
@@ -220,7 +220,7 @@ class LogPriority extends Enum with LogriorityMixin implements Comparable<LogPri
220220
LogPriority._$(int _$index, String _$name, this.priority, this.prefix)
221221
: super(_$index, _$name);
222222
LogPriority._$unknown(int _$index, String _$name, String prefix) :
223-
: this._$(_$index, _$name, prefix, -1);
223+
: this._$(_$index, _$name, -1, prefix);
224224
225225
final String prefix;
226226
final int priorty;
@@ -272,7 +272,7 @@ class Plain extends Enum {
272272
static const Plain baz = Plain._$(2, "baz");
273273
static const List<Plain> values = [foo, bar, baz];
274274
275-
const Plain._$(int _$index, String_ $name) : super._(_$index, $_name);
275+
const Plain._$(int _$index, String _$name) : super._(_$index, _$name);
276276
277277
// Private names from `dart:core`.
278278
String _$enumToString() => "Plain.${_$name}";
@@ -346,8 +346,8 @@ enum Complex<T extends Pattern> with EnumComparable<Complex> implements Pattern
346346
}
347347
348348
// Named constructor. Redirecting.
349-
const Complex.captured(String regexpPattern)
350-
: this("($regexpPattern)", RegExp);
349+
const Complex.captured(String regexpPattern, T Function(String) factory)
350+
: this("($regexpPattern)", factory);
351351
352352
// Can expose the implicit name.
353353
String get name => EnumName(this).name;
@@ -396,8 +396,8 @@ class Complex<T extends Pattern> extends Enum with EnumComparable<Complex>
396396
throw UnsupportedError("No pattern matching: $text");
397397
}
398398
399-
const Complex.captured(int _$index, String _$name, String regexpPattern)
400-
: this(_$index, _$name, "($regexpPattern)", RegExp);
399+
const Complex.captured(int _$index, String _$name, String regexpPattern, T Function(String) factory)
400+
: this(_$index, _$name, "($regexpPattern)", factory);
401401
402402
String get name => EnumName(this).name;
403403

0 commit comments

Comments
 (0)