@@ -937,8 +937,8 @@ class _MockTargetGatherer {
937
937
final className = interfaceElement.name3;
938
938
final substitution = Substitution .fromInterfaceType (mockTarget.classType);
939
939
final relevantMembers = _inheritanceManager
940
- .getInterface2 (interfaceElement)
941
- .map2
940
+ .getInterface (interfaceElement)
941
+ .map
942
942
.values
943
943
.where ((m) => ! m.isPrivate && ! m.isStatic)
944
944
.map ((member) => ExecutableMember .from (member, substitution));
@@ -1247,16 +1247,15 @@ class _MockClassInfo {
1247
1247
});
1248
1248
1249
1249
Class _buildMockClass () {
1250
- final typeAlias = mockTarget.classType.alias;
1251
- final aliasedElement = typeAlias? .element2;
1252
- final aliasedType =
1253
- typeAlias? .element2.aliasedType as analyzer.InterfaceType ? ;
1250
+ final instantiatedAlias = mockTarget.classType.alias;
1251
+ final aliasElement = instantiatedAlias? .element;
1252
+ final aliasedType = aliasElement? .aliasedType as analyzer.InterfaceType ? ;
1254
1253
final typeToMock = aliasedType ?? mockTarget.classType;
1255
1254
final classToMock = mockTarget.interfaceElement;
1256
1255
final classIsImmutable = classToMock.metadata2.annotations.any (
1257
1256
(it) => it.isImmutable,
1258
1257
);
1259
- final className = aliasedElement ? .name3 ?? classToMock.name3;
1258
+ final className = aliasElement ? .name3 ?? classToMock.name3;
1260
1259
1261
1260
return Class ((cBuilder) {
1262
1261
cBuilder
@@ -1278,9 +1277,9 @@ class _MockClassInfo {
1278
1277
// the "implements" clause.
1279
1278
1280
1279
final typeParameters =
1281
- aliasedElement ? .typeParameters2 ?? classToMock.typeParameters2;
1280
+ aliasElement ? .typeParameters2 ?? classToMock.typeParameters2;
1282
1281
final typeArguments =
1283
- typeAlias ? .typeArguments ?? typeToMock.typeArguments;
1282
+ instantiatedAlias ? .typeArguments ?? typeToMock.typeArguments;
1284
1283
1285
1284
_withTypeParameters (
1286
1285
mockTarget.hasExplicitTypeArguments ? [] : typeParameters,
@@ -1300,7 +1299,7 @@ class _MockClassInfo {
1300
1299
TypeReference ((b) {
1301
1300
b
1302
1301
..symbol = className
1303
- ..url = _typeImport (aliasedElement ?? classToMock)
1302
+ ..url = _typeImport (aliasElement ?? classToMock)
1304
1303
..types.addAll (
1305
1304
mockTarget.hasExplicitTypeArguments
1306
1305
? typeArguments.map (_typeReference)
@@ -1313,15 +1312,12 @@ class _MockClassInfo {
1313
1312
}
1314
1313
1315
1314
final substitution = Substitution .fromPairs2 (
1316
- [
1317
- ...classToMock.typeParameters2,
1318
- ...? aliasedElement? .typeParameters2,
1319
- ],
1320
- [...typeToMock.typeArguments, ...? typeAlias? .typeArguments],
1315
+ [...classToMock.typeParameters2, ...? aliasElement? .typeParameters2],
1316
+ [...typeToMock.typeArguments, ...? instantiatedAlias? .typeArguments],
1321
1317
);
1322
1318
final members = inheritanceManager
1323
- .getInterface2 (classToMock)
1324
- .map2
1319
+ .getInterface (classToMock)
1320
+ .map
1325
1321
.values
1326
1322
.map ((member) => ExecutableMember .from (member, substitution));
1327
1323
0 commit comments