Skip to content

Commit 70fbbd2

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Migrate TypeInferenceElementTest.
Change-Id: I1e1bafc95ec1095d670cab51e394bd0daa2a9790 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406203 Reviewed-by: Phil Quitslund <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent af6b3f4 commit 70fbbd2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/analyzer/test/src/summary/elements/type_inference_test.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +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-
7-
import 'package:analyzer/dart/element/element.dart';
85
import 'package:analyzer/dart/element/type.dart';
96
import 'package:test/test.dart';
107
import 'package:test_reflective_loader/test_reflective_loader.dart';
@@ -4349,13 +4346,16 @@ library
43494346
requiredPositional hasImplicitType p
43504347
type: Stream<dynamic>
43514348
''');
4352-
ClassElement b = library.definingCompilationUnit.classes[0];
4353-
ParameterElement p = b.methods[0].parameters[0];
4349+
var b = library.classes[0];
4350+
var p = b.methods2[0].formalParameters[0];
43544351
// This test should verify that we correctly record inferred types,
43554352
// when the type is defined in a part of an SDK library. So, test that
43564353
// the type is actually in a part.
4357-
var streamElement = (p.type as InterfaceType).element;
4358-
expect(streamElement.source, isNot(streamElement.library.source));
4354+
var streamElement = (p.type as InterfaceType).element3;
4355+
expect(
4356+
streamElement.firstFragment.libraryFragment.source,
4357+
isNot(streamElement.library2.firstFragment.source),
4358+
);
43594359
}
43604360

43614361
test_inferredType_implicitCreation() async {

0 commit comments

Comments
 (0)