Skip to content

Commit bb0cabb

Browse files
pqCommit Queue
authored andcommitted
[element model] migrate subtype_test
Change-Id: I3a0d04c5e51720cdbd04613a1d03a13bae711ecc Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405261 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Phil Quitslund <[email protected]>
1 parent 26f2206 commit bb0cabb

File tree

2 files changed

+126
-91
lines changed

2 files changed

+126
-91
lines changed

pkg/analyzer/test/generated/elements_types_mixin.dart

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import 'package:_fe_analyzer_shared/src/type_inference/type_analyzer_operations.dart';
88
import 'package:analyzer/dart/analysis/features.dart';
99
import 'package:analyzer/dart/element/element.dart';
10+
import 'package:analyzer/dart/element/element2.dart';
1011
import 'package:analyzer/dart/element/nullability_suffix.dart';
1112
import 'package:analyzer/dart/element/type.dart';
1213
import 'package:analyzer/source/line_info.dart';
@@ -20,6 +21,7 @@ import 'package:analyzer/src/dart/element/type_system.dart';
2021
import 'package:analyzer/src/generated/engine.dart';
2122
import 'package:analyzer/src/generated/utilities_dart.dart';
2223
import 'package:analyzer/src/summary2/reference.dart';
24+
import 'package:analyzer/src/utilities/extensions/element.dart';
2325
import 'package:test/test.dart';
2426

2527
mixin ElementsTypesMixin {
@@ -506,6 +508,16 @@ mixin ElementsTypesMixin {
506508
);
507509
}
508510

511+
TypeParameterTypeImpl promotedTypeParameterTypeNone2(
512+
TypeParameterElement2 element,
513+
DartType promotedBound,
514+
) {
515+
return promotedTypeParameterTypeNone(
516+
element.asElement,
517+
promotedBound,
518+
);
519+
}
520+
509521
TypeParameterTypeImpl promotedTypeParameterTypeQuestion(
510522
TypeParameterElement element,
511523
DartType promotedBound,
@@ -608,6 +620,11 @@ mixin ElementsTypesMixin {
608620
return element;
609621
}
610622

623+
TypeParameterElement2 typeParameter2(String name,
624+
{DartType? bound, Variance? variance}) {
625+
return typeParameter(name, bound: bound, variance: variance).asElement2;
626+
}
627+
611628
TypeParameterTypeImpl typeParameterType(
612629
TypeParameterElement element, {
613630
required NullabilitySuffix nullabilitySuffix,
@@ -631,6 +648,16 @@ mixin ElementsTypesMixin {
631648
);
632649
}
633650

651+
TypeParameterTypeImpl typeParameterTypeNone2(
652+
TypeParameterElement2 element, {
653+
DartType? promotedBound,
654+
}) {
655+
return typeParameterTypeNone(
656+
element.asElement,
657+
promotedBound: promotedBound,
658+
);
659+
}
660+
634661
TypeParameterTypeImpl typeParameterTypeQuestion(
635662
TypeParameterElement element, {
636663
DartType? promotedBound,
@@ -641,6 +668,16 @@ mixin ElementsTypesMixin {
641668
promotedBound: promotedBound,
642669
);
643670
}
671+
672+
TypeParameterTypeImpl typeParameterTypeQuestion2(
673+
TypeParameterElement2 element, {
674+
DartType? promotedBound,
675+
}) {
676+
return typeParameterTypeQuestion(
677+
element.asElement,
678+
promotedBound: promotedBound,
679+
);
680+
}
644681
}
645682

646683
class _MockSource implements Source {

0 commit comments

Comments
 (0)