Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1559)

Unified Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2981063002: Resynthesize interfaces from Kernel. (Closed)
Patch Set: Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/element/element.dart
diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart
index 756fec6a6a8717a6b4a68f657b9443f85e1d48f3..8d141146ba97c396f4feb27ac5fa2336b46576a1 100644
--- a/pkg/analyzer/lib/src/dart/element/element.dart
+++ b/pkg/analyzer/lib/src/dart/element/element.dart
@@ -746,12 +746,19 @@ class ClassElementImpl extends AbstractClassElementImpl
@override
List<InterfaceType> get interfaces {
- if (_unlinkedClass != null && _interfaces == null) {
- ResynthesizerContext context = enclosingUnit.resynthesizerContext;
- _interfaces = _unlinkedClass.interfaces
- .map((EntityRef t) => context.resolveTypeRef(this, t))
- .where(_isClassInterfaceType)
- .toList(growable: false);
+ if (_interfaces == null) {
+ if (_kernel != null) {
+ _interfaces = _kernel.implementedTypes
+ .map((k) => enclosingUnit._kernelContext.getInterfaceType(this, k))
+ .toList(growable: false);
+ }
+ if (_unlinkedClass != null) {
+ ResynthesizerContext context = enclosingUnit.resynthesizerContext;
+ _interfaces = _unlinkedClass.interfaces
+ .map((EntityRef t) => context.resolveTypeRef(this, t))
+ .where(_isClassInterfaceType)
+ .toList(growable: false);
+ }
}
return _interfaces ?? const <InterfaceType>[];
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_kernel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698