@@ -2363,8 +2363,7 @@ void main() {
2363
2363
function1,
2364
2364
topLevelFunction,
2365
2365
aFunctionUsingRenamedLib;
2366
- TopLevelVariable aSetterWithFunctionParameter,
2367
- incorrectDocReference,
2366
+ TopLevelVariable incorrectDocReference,
2368
2367
incorrectDocReferenceFromEx,
2369
2368
nameWithTwoUnderscores,
2370
2369
nameWithSingleUnderscore,
@@ -2393,14 +2392,12 @@ void main() {
2393
2392
redHerring,
2394
2393
yetAnotherName,
2395
2394
somethingShadowyParameter;
2396
- Parameter fParam, fParamA, fParamB, fParamC;
2397
2395
Field forInheriting,
2398
2396
action,
2399
2397
initializeMe,
2400
2398
somethingShadowy,
2401
2399
aConstructorShadowedField,
2402
2400
aNameField,
2403
- anotherNameField,
2404
2401
yetAnotherNameField,
2405
2402
initViaFieldFormal;
2406
2403
@@ -2506,8 +2503,6 @@ void main() {
2506
2503
2507
2504
aNameField = FactoryConstructorThings .allFields
2508
2505
.firstWhere ((f) => f.name == 'aName' );
2509
- anotherNameField = FactoryConstructorThings .allFields
2510
- .firstWhere ((f) => f.name == 'anotherName' );
2511
2506
yetAnotherNameField = FactoryConstructorThings .allFields
2512
2507
.firstWhere ((f) => f.name == 'yetAnotherName' );
2513
2508
initViaFieldFormal = FactoryConstructorThings .allFields
@@ -2517,24 +2512,24 @@ void main() {
2517
2512
.firstWhere ((m) => m.name == 'aMethod' );
2518
2513
yetAnotherName =
2519
2514
aMethod.allParameters.firstWhere ((p) => p.name == 'yetAnotherName' );
2520
-
2521
- aSetterWithFunctionParameter = fakeLibrary.properties
2522
- .firstWhere ((p) => p.name == 'aSetterWithFunctionParameter' );
2523
- fParam = aSetterWithFunctionParameter.parameters
2524
- .firstWhere ((p) => p.name == 'fParam' );
2525
- fParamA = (fParam.modelType as Callable )
2526
- .parameters
2527
- .firstWhere ((p) => p.name == 'fParamA' );
2528
- fParamB = (fParam.modelType as Callable )
2529
- .parameters
2530
- .firstWhere ((p) => p.name == 'fParamB' );
2531
- fParamC = (fParam.modelType as Callable )
2532
- .parameters
2533
- .firstWhere ((p) => p.name == 'fParamC' );
2534
2515
});
2535
2516
2536
2517
group ('Parameter references work properly' , () {
2537
2518
test ('via a setter with a function parameter' , () {
2519
+ var aSetterWithFunctionParameter = fakeLibrary.properties
2520
+ .firstWhere ((p) => p.name == 'aSetterWithFunctionParameter' );
2521
+ var fParam = aSetterWithFunctionParameter.parameters
2522
+ .firstWhere ((p) => p.name == 'fParam' );
2523
+ var fParamA = (fParam.modelType as Callable )
2524
+ .parameters
2525
+ .firstWhere ((p) => p.name == 'fParamA' );
2526
+ var fParamB = (fParam.modelType as Callable )
2527
+ .parameters
2528
+ .firstWhere ((p) => p.name == 'fParamB' );
2529
+ var fParamC = (fParam.modelType as Callable )
2530
+ .parameters
2531
+ .firstWhere ((p) => p.name == 'fParamC' );
2532
+
2538
2533
expect (bothLookup (aSetterWithFunctionParameter, 'fParam.fParamA' ),
2539
2534
equals (MatchingLinkResult (fParamA)));
2540
2535
expect (bothLookup (aSetterWithFunctionParameter, 'fParam.fParamB' ),
@@ -2546,6 +2541,8 @@ void main() {
2546
2541
test ('in class scope overridden by fields' , () {
2547
2542
expect (bothLookup (FactoryConstructorThings , 'aName' ),
2548
2543
equals (MatchingLinkResult (aNameField)));
2544
+ var anotherNameField = FactoryConstructorThings .allFields
2545
+ .firstWhere ((f) => f.name == 'anotherName' );
2549
2546
expect (bothLookup (FactoryConstructorThings , 'anotherName' ),
2550
2547
equals (MatchingLinkResult (anotherNameField)));
2551
2548
expect (bothLookup (FactoryConstructorThings , 'yetAnotherName' ),
@@ -2769,6 +2766,14 @@ void main() {
2769
2766
expect (bothLookup (doAwesomeStuff, 'ExtendedBaseReexported.action' ),
2770
2767
equals (MatchingLinkResult (action)));
2771
2768
});
2769
+
2770
+ test ('displays default value of field formal parameter' , () {
2771
+ expect (
2772
+ factoryConstructorThingsDefault.linkedParamsLines,
2773
+ contains (
2774
+ '<span class="parameter-name">fieldFormalWithDefault</span> = '
2775
+ '<span class="default-value">7</span>}' ));
2776
+ });
2772
2777
});
2773
2778
});
2774
2779
0 commit comments