@@ -2363,8 +2363,7 @@ void main() {
23632363 function1,
23642364 topLevelFunction,
23652365 aFunctionUsingRenamedLib;
2366- TopLevelVariable aSetterWithFunctionParameter,
2367- incorrectDocReference,
2366+ TopLevelVariable incorrectDocReference,
23682367 incorrectDocReferenceFromEx,
23692368 nameWithTwoUnderscores,
23702369 nameWithSingleUnderscore,
@@ -2393,14 +2392,12 @@ void main() {
23932392 redHerring,
23942393 yetAnotherName,
23952394 somethingShadowyParameter;
2396- Parameter fParam, fParamA, fParamB, fParamC;
23972395 Field forInheriting,
23982396 action,
23992397 initializeMe,
24002398 somethingShadowy,
24012399 aConstructorShadowedField,
24022400 aNameField,
2403- anotherNameField,
24042401 yetAnotherNameField,
24052402 initViaFieldFormal;
24062403
@@ -2506,8 +2503,6 @@ void main() {
25062503
25072504 aNameField = FactoryConstructorThings .allFields
25082505 .firstWhere ((f) => f.name == 'aName' );
2509- anotherNameField = FactoryConstructorThings .allFields
2510- .firstWhere ((f) => f.name == 'anotherName' );
25112506 yetAnotherNameField = FactoryConstructorThings .allFields
25122507 .firstWhere ((f) => f.name == 'yetAnotherName' );
25132508 initViaFieldFormal = FactoryConstructorThings .allFields
@@ -2517,24 +2512,24 @@ void main() {
25172512 .firstWhere ((m) => m.name == 'aMethod' );
25182513 yetAnotherName =
25192514 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' );
25342515 });
25352516
25362517 group ('Parameter references work properly' , () {
25372518 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+
25382533 expect (bothLookup (aSetterWithFunctionParameter, 'fParam.fParamA' ),
25392534 equals (MatchingLinkResult (fParamA)));
25402535 expect (bothLookup (aSetterWithFunctionParameter, 'fParam.fParamB' ),
@@ -2546,6 +2541,8 @@ void main() {
25462541 test ('in class scope overridden by fields' , () {
25472542 expect (bothLookup (FactoryConstructorThings , 'aName' ),
25482543 equals (MatchingLinkResult (aNameField)));
2544+ var anotherNameField = FactoryConstructorThings .allFields
2545+ .firstWhere ((f) => f.name == 'anotherName' );
25492546 expect (bothLookup (FactoryConstructorThings , 'anotherName' ),
25502547 equals (MatchingLinkResult (anotherNameField)));
25512548 expect (bothLookup (FactoryConstructorThings , 'yetAnotherName' ),
@@ -2769,6 +2766,14 @@ void main() {
27692766 expect (bothLookup (doAwesomeStuff, 'ExtendedBaseReexported.action' ),
27702767 equals (MatchingLinkResult (action)));
27712768 });
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+ });
27722777 });
27732778 });
27742779
0 commit comments