Skip to content

Commit 2d367c8

Browse files
stereotype441Commit Queue
authored andcommitted
[mini_types] Decouple NamedFunctionParameter from NamedType.
Previously, NamedFunctionParameter was derived from NamedType. This avoided a tiny amount of code duplication, but the benefit was really tiny. Decoupling the two classes simplifies the implementation of a follow-up CL that I have in progress, which will allow the mini_types framework to represent function types. Change-Id: I29bff36ab76bbf344cf7204f2503b006a88a4cf8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/395422 Reviewed-by: Kallen Tu <[email protected]> Commit-Queue: Paul Berry <[email protected]>
1 parent ca9c123 commit 2d367c8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/_fe_analyzer_shared/test/mini_types.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,19 @@ class InvalidType extends _SpecialSimpleType
180180
}
181181

182182
/// A named parameter of a function type.
183-
class NamedFunctionParameter extends NamedType
183+
class NamedFunctionParameter
184184
implements SharedNamedFunctionParameterStructure<Type> {
185+
@override
186+
final String name;
187+
188+
@override
189+
final Type type;
190+
185191
@override
186192
final bool isRequired;
187193

188194
NamedFunctionParameter(
189-
{required this.isRequired, required super.name, required super.type});
195+
{required this.isRequired, required this.name, required this.type});
190196

191197
@override
192198
String toString() => [if (isRequired) 'required', type, name].join(' ');

0 commit comments

Comments
 (0)