@@ -69,8 +69,10 @@ class InformativeDataApplier {
6969 unitElement.setCodeRange (unitInfo.codeOffset, unitInfo.codeLength);
7070 unitElement.lineInfo = LineInfo (unitInfo.lineStarts);
7171
72- _applyToImports (unitElement.libraryImports_unresolved, unitInfo);
73- _applyToExports (unitElement.libraryExports_unresolved, unitInfo);
72+ unitElement.withoutLoadingResolution (() {
73+ _applyToImports (unitElement.libraryImports, unitInfo);
74+ _applyToExports (unitElement.libraryExports, unitInfo);
75+ });
7476
7577 unitElement.deferConstantOffsets (unitInfo.libraryConstantOffsets, (
7678 applier,
@@ -169,12 +171,15 @@ class InformativeDataApplier {
169171 element.firstTokenOffset = info.firstTokenOffset;
170172 element.nameOffset = info.nameOffset2;
171173 element.documentationComment = info.documentationComment;
172- _applyToFormalParameters (element.parameters_unresolved, info.parameters);
174+
175+ element.withoutLoadingResolution (() {
176+ _applyToFormalParameters (element.parameters, info.parameters);
177+ });
173178
174179 element.deferConstantOffsets (info.constantOffsets, (applier) {
175180 applier.applyToMetadata (element.metadata);
176181 applier.applyToTypeParameters (element.typeParameters);
177- applier.applyToFormalParameters (element.parameters_unresolved );
182+ applier.applyToFormalParameters (element.parameters );
178183 });
179184 });
180185 }
@@ -187,10 +192,10 @@ class InformativeDataApplier {
187192 element.firstTokenOffset = info.firstTokenOffset;
188193 element.nameOffset = info.nameOffset2;
189194 element.documentationComment = info.documentationComment;
190- _applyToTypeParameters (
191- element.typeParameters_unresolved,
192- info .typeParameters,
193- );
195+
196+ element.withoutLoadingResolution (() {
197+ _applyToTypeParameters (element .typeParameters, info.typeParameters);
198+ } );
194199
195200 element.deferConstantOffsets (info.constantOffsets, (applier) {
196201 applier.applyToMetadata (element.metadata);
@@ -216,10 +221,10 @@ class InformativeDataApplier {
216221 element.firstTokenOffset = info.firstTokenOffset;
217222 element.nameOffset = info.nameOffset2;
218223 element.documentationComment = info.documentationComment;
219- _applyToTypeParameters (
220- element.typeParameters_unresolved,
221- info .typeParameters,
222- );
224+
225+ element.withoutLoadingResolution (() {
226+ _applyToTypeParameters (element .typeParameters, info.typeParameters);
227+ } );
223228
224229 element.deferConstantOffsets (info.constantOffsets, (applier) {
225230 applier.applyToMetadata (element.metadata);
@@ -260,7 +265,9 @@ class InformativeDataApplier {
260265 element.nameOffset = info.nameOffset2;
261266 element.documentationComment = info.documentationComment;
262267
263- _applyToFormalParameters (element.parameters_unresolved, info.parameters);
268+ element.withoutLoadingResolution (() {
269+ _applyToFormalParameters (element.parameters, info.parameters);
270+ });
264271
265272 element.deferConstantOffsets (info.constantOffsets, (applier) {
266273 applier.applyToMetadata (element.metadata);
@@ -279,7 +286,6 @@ class InformativeDataApplier {
279286 element.nameOffset = info.nameOffset2;
280287 element.documentationComment = info.documentationComment;
281288
282- // TODO(scheglov): use it everywhere
283289 element.withoutLoadingResolution (() {
284290 _applyToTypeParameters (element.typeParameters, info.typeParameters);
285291 _applyToConstructors (element.constructors, info.constructors);
@@ -310,10 +316,11 @@ class InformativeDataApplier {
310316 element.firstTokenOffset = info.firstTokenOffset;
311317 element.nameOffset = info.nameOffset2;
312318 element.documentationComment = info.documentationComment;
313- _applyToTypeParameters (
314- element.typeParameters_unresolved,
315- info.typeParameters,
316- );
319+
320+ element.withoutLoadingResolution (() {
321+ _applyToTypeParameters (element.typeParameters, info.typeParameters);
322+ });
323+
317324 _applyToFields (element.fields, info.fields);
318325 _applyToAccessors (element.getters, info.getters);
319326 _applyToAccessors (element.setters, info.setters);
@@ -333,10 +340,10 @@ class InformativeDataApplier {
333340 element.firstTokenOffset = info.firstTokenOffset;
334341 element.nameOffset = info.nameOffset2;
335342 element.documentationComment = info.documentationComment;
336- _applyToTypeParameters (
337- element.typeParameters_unresolved,
338- info .typeParameters,
339- );
343+
344+ element.withoutLoadingResolution (() {
345+ _applyToTypeParameters (element .typeParameters, info.typeParameters);
346+ } );
340347
341348 var representationField = element.fields.first;
342349 var infoRep = info.representation;
@@ -360,14 +367,12 @@ class InformativeDataApplier {
360367 primaryConstructor.nameOffset = infoRep.constructorNameOffset2;
361368 primaryConstructor.nameEnd = infoRep.constructorNameEnd;
362369
363- var primaryConstructorParameter =
364- primaryConstructor.parameters_unresolved.first;
365- primaryConstructorParameter.firstTokenOffset = infoRep.firstTokenOffset;
366- primaryConstructorParameter.nameOffset = infoRep.fieldNameOffset2;
367- primaryConstructorParameter.setCodeRange (
368- infoRep.codeOffset,
369- infoRep.codeLength,
370- );
370+ primaryConstructor.withoutLoadingResolution (() {
371+ var representation = primaryConstructor.parameters.first;
372+ representation.firstTokenOffset = infoRep.firstTokenOffset;
373+ representation.nameOffset = infoRep.fieldNameOffset2;
374+ representation.setCodeRange (infoRep.codeOffset, infoRep.codeLength);
375+ });
371376
372377 var restFields = element.fields.skip (1 ).toList ();
373378 _applyToFields (restFields, info.fields);
@@ -425,11 +430,11 @@ class InformativeDataApplier {
425430 element.firstTokenOffset = info.firstTokenOffset;
426431 element.nameOffset = info.nameOffset2;
427432 element.documentationComment = info.documentationComment;
428- _applyToTypeParameters (
429- element.typeParameters_unresolved,
430- info .typeParameters,
431- );
432- _applyToFormalParameters (element.parameters_unresolved, info.parameters );
433+
434+ element.withoutLoadingResolution (() {
435+ _applyToTypeParameters (element .typeParameters, info.typeParameters);
436+ _applyToFormalParameters (element.parameters, info.parameters );
437+ } );
433438
434439 element.deferConstantOffsets (info.constantOffsets, (applier) {
435440 applier.applyToMetadata (element.metadata);
@@ -446,14 +451,13 @@ class InformativeDataApplier {
446451 element.firstTokenOffset = info.firstTokenOffset;
447452 element.nameOffset = info.nameOffset2;
448453 element.documentationComment = info.documentationComment;
449- _applyToTypeParameters (
450- element.typeParameters_unresolved,
451- info.typeParameters,
452- );
453- if (element.aliasedElement_unresolved
454- case GenericFunctionTypeFragmentImpl aliased) {
455- _applyToFormalParameters (aliased.parameters, info.parameters);
456- }
454+
455+ element.withoutLoadingResolution (() {
456+ _applyToTypeParameters (element.typeParameters, info.typeParameters);
457+ if (element.aliasedElement case GenericFunctionTypeFragmentImpl aliased) {
458+ _applyToFormalParameters (aliased.parameters, info.parameters);
459+ }
460+ });
457461
458462 _setupApplyConstantOffsetsForTypeAlias (
459463 element,
@@ -470,21 +474,20 @@ class InformativeDataApplier {
470474 element.firstTokenOffset = info.firstTokenOffset;
471475 element.nameOffset = info.nameOffset2;
472476 element.documentationComment = info.documentationComment;
473- _applyToTypeParameters (
474- element.typeParameters_unresolved,
475- info.typeParameters,
476- );
477- if (element.aliasedElement_unresolved
478- case GenericFunctionTypeFragmentImpl aliased) {
479- _applyToTypeParameters (
480- aliased.typeParameters,
481- info.aliasedTypeParameters,
482- );
483- _applyToFormalParameters (
484- aliased.parameters,
485- info.aliasedFormalParameters,
486- );
487- }
477+
478+ element.withoutLoadingResolution (() {
479+ _applyToTypeParameters (element.typeParameters, info.typeParameters);
480+ if (element.aliasedElement case GenericFunctionTypeFragmentImpl aliased) {
481+ _applyToTypeParameters (
482+ aliased.typeParameters,
483+ info.aliasedTypeParameters,
484+ );
485+ _applyToFormalParameters (
486+ aliased.parameters,
487+ info.aliasedFormalParameters,
488+ );
489+ }
490+ });
488491
489492 _setupApplyConstantOffsetsForTypeAlias (
490493 element,
@@ -524,11 +527,11 @@ class InformativeDataApplier {
524527 element.firstTokenOffset = info.firstTokenOffset;
525528 element.nameOffset = info.nameOffset2;
526529 element.documentationComment = info.documentationComment;
527- _applyToTypeParameters (
528- element.typeParameters_unresolved,
529- info .typeParameters,
530- );
531- _applyToFormalParameters (element.parameters_unresolved, info.parameters );
530+
531+ element.withoutLoadingResolution (() {
532+ _applyToTypeParameters (element .typeParameters, info.typeParameters);
533+ _applyToFormalParameters (element.parameters, info.parameters );
534+ } );
532535
533536 element.deferConstantOffsets (info.constantOffsets, (applier) {
534537 applier.applyToMetadata (element.metadata);
@@ -547,7 +550,6 @@ class InformativeDataApplier {
547550 element.nameOffset = info.nameOffset2;
548551 element.documentationComment = info.documentationComment;
549552
550- // TODO(scheglov): use it everywhere
551553 element.withoutLoadingResolution (() {
552554 _applyToTypeParameters (element.typeParameters, info.typeParameters);
553555 _applyToConstructors (element.constructors, info.constructors);
0 commit comments