File tree 3 files changed +2
-25
lines changed 3 files changed +2
-25
lines changed Original file line number Diff line number Diff line change 5
5
* Allow generating a mock class which includes overriding members with private
6
6
types in their signature. Such members cannot be stubbed with mockito, and
7
7
will only be generated when specified in MockSpec ` unsupportedMembers ` .
8
- * Include ` required ` keyword in functions used as default return values.
9
8
10
9
## 5.3.0
11
10
Original file line number Diff line number Diff line change @@ -1492,11 +1492,7 @@ class _MockClassInfo {
1492
1492
superParameterType: parameter.type, defaultName: '__p$position ' );
1493
1493
b.optionalParameters.add (matchingParameter);
1494
1494
position++ ;
1495
- } else if (parameter.isOptionalNamed) {
1496
- final matchingParameter =
1497
- _matchingParameter (parameter, superParameterType: parameter.type);
1498
- b.optionalParameters.add (matchingParameter);
1499
- } else if (parameter.isRequiredNamed) {
1495
+ } else if (parameter.isNamed) {
1500
1496
final matchingParameter =
1501
1497
_matchingParameter (parameter, superParameterType: parameter.type);
1502
1498
b.optionalParameters.add (matchingParameter);
@@ -1599,7 +1595,6 @@ class _MockClassInfo {
1599
1595
_typeReference (superParameterType, forceNullable: forceNullable);
1600
1596
}
1601
1597
if (parameter.isNamed) pBuilder.named = true ;
1602
- if (parameter.isRequiredNamed) pBuilder.required = true ;
1603
1598
if (parameter.defaultValueCode != null ) {
1604
1599
try {
1605
1600
pBuilder.defaultTo = _expressionFromDartObject (
Original file line number Diff line number Diff line change @@ -1524,7 +1524,7 @@ void main() {
1524
1524
void m({required covariant int a});
1525
1525
}
1526
1526
''' ),
1527
- _containsAllOf ('void m({required num? a}) => super.noSuchMethod(' ),
1527
+ _containsAllOf ('void m({num? a}) => super.noSuchMethod(' ),
1528
1528
);
1529
1529
});
1530
1530
@@ -2455,23 +2455,6 @@ void main() {
2455
2455
);
2456
2456
});
2457
2457
2458
- test (
2459
- 'creates a dummy non-null function-typed return value, with required '
2460
- 'named parameters' , () async {
2461
- await expectSingleNonNullableOutput (
2462
- dedent (r'''
2463
- abstract class Foo {
2464
- void Function(Foo, {required bool b}) m();
2465
- }
2466
- ''' ),
2467
- _containsAllOf ('''
2468
- returnValue: (
2469
- _i2.Foo __p0, {
2470
- required bool b,
2471
- }) {},''' ),
2472
- );
2473
- });
2474
-
2475
2458
test (
2476
2459
'creates a dummy non-null function-typed return value, with non-core '
2477
2460
'return type' , () async {
You can’t perform that action at this time.
0 commit comments