Skip to content

Commit c93b1ff

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate DartObjectImplTest.
Change-Id: Id748ad77dd7692a04d6b432619ab3dad9da9eaa4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/407501 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 1372538 commit c93b1ff

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pkg/analyzer/lib/src/test_utilities/mock_sdk_elements.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,10 +1080,12 @@ class _MockSdkElementsBuilder {
10801080
List<TypeParameterElementImpl> typeFormals = const [],
10811081
List<ParameterElementImpl> parameters = const [],
10821082
}) {
1083-
return MethodElementImpl(name, 0)
1083+
var fragment = MethodElementImpl(name, 0)
10841084
..parameters = parameters
10851085
..returnType = returnType
10861086
..typeParameters = typeFormals;
1087+
MethodElementImpl2(Reference.root(), name, fragment);
1088+
return fragment;
10871089
}
10881090

10891091
ParameterElementImpl _namedParameter(String name, TypeImpl type,

pkg/analyzer/test/src/dart/constant/value_test.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// ignore_for_file: analyzer_use_new_elements
6-
75
import 'package:analyzer/dart/analysis/features.dart';
86
import 'package:analyzer/dart/element/nullability_suffix.dart';
97
import 'package:analyzer/dart/element/type.dart';
@@ -908,7 +906,7 @@ class DartObjectImplTest {
908906
[],
909907
),
910908
_listValue(
911-
_typeProvider.futureOrElement.instantiate(
909+
_typeProvider.futureOrElement2.instantiate(
912910
typeArguments: [_typeProvider.objectType],
913911
nullabilitySuffix: NullabilitySuffix.none,
914912
),
@@ -961,7 +959,7 @@ class DartObjectImplTest {
961959
),
962960
_mapValue(
963961
_typeProvider.intType,
964-
_typeProvider.futureOrElement.instantiate(
962+
_typeProvider.futureOrElement2.instantiate(
965963
typeArguments: [_typeProvider.objectType],
966964
nullabilitySuffix: NullabilitySuffix.none,
967965
),
@@ -1066,8 +1064,8 @@ class DartObjectImplTest {
10661064
}
10671065

10681066
void test_identical_Type_functionType() {
1069-
var toStringType = _typeProvider.intType.methods
1070-
.firstWhere((e) => e.name == 'toString')
1067+
var toStringType = _typeProvider.intType.methods2
1068+
.firstWhere((e) => e.name3 == 'toString')
10711069
.type;
10721070

10731071
_assertIdentical(

0 commit comments

Comments
 (0)