OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library analyzer.src.dart.element.element; | 5 library analyzer.src.dart.element.element; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 import 'dart:math' show min; | 8 import 'dart:math' show min; |
9 | 9 |
10 import 'package:analyzer/dart/ast/ast.dart'; | 10 import 'package:analyzer/dart/ast/ast.dart'; |
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 for (PropertyAccessorElement accessor in accessors) { | 739 for (PropertyAccessorElement accessor in accessors) { |
740 if (accessor.isStatic) { | 740 if (accessor.isStatic) { |
741 return true; | 741 return true; |
742 } | 742 } |
743 } | 743 } |
744 return false; | 744 return false; |
745 } | 745 } |
746 | 746 |
747 @override | 747 @override |
748 List<InterfaceType> get interfaces { | 748 List<InterfaceType> get interfaces { |
749 if (_unlinkedClass != null && _interfaces == null) { | 749 if (_interfaces == null) { |
750 ResynthesizerContext context = enclosingUnit.resynthesizerContext; | 750 if (_kernel != null) { |
751 _interfaces = _unlinkedClass.interfaces | 751 _interfaces = _kernel.implementedTypes |
752 .map((EntityRef t) => context.resolveTypeRef(this, t)) | 752 .map((k) => enclosingUnit._kernelContext.getInterfaceType(this, k)) |
753 .where(_isClassInterfaceType) | 753 .toList(growable: false); |
754 .toList(growable: false); | 754 } |
| 755 if (_unlinkedClass != null) { |
| 756 ResynthesizerContext context = enclosingUnit.resynthesizerContext; |
| 757 _interfaces = _unlinkedClass.interfaces |
| 758 .map((EntityRef t) => context.resolveTypeRef(this, t)) |
| 759 .where(_isClassInterfaceType) |
| 760 .toList(growable: false); |
| 761 } |
755 } | 762 } |
756 return _interfaces ?? const <InterfaceType>[]; | 763 return _interfaces ?? const <InterfaceType>[]; |
757 } | 764 } |
758 | 765 |
759 void set interfaces(List<InterfaceType> interfaces) { | 766 void set interfaces(List<InterfaceType> interfaces) { |
760 _assertNotResynthesized(_unlinkedClass); | 767 _assertNotResynthesized(_unlinkedClass); |
761 _interfaces = interfaces; | 768 _interfaces = interfaces; |
762 } | 769 } |
763 | 770 |
764 @override | 771 @override |
(...skipping 8336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9101 | 9108 |
9102 @override | 9109 @override |
9103 DartObject computeConstantValue() => null; | 9110 DartObject computeConstantValue() => null; |
9104 | 9111 |
9105 @override | 9112 @override |
9106 void visitChildren(ElementVisitor visitor) { | 9113 void visitChildren(ElementVisitor visitor) { |
9107 super.visitChildren(visitor); | 9114 super.visitChildren(visitor); |
9108 _initializer?.accept(visitor); | 9115 _initializer?.accept(visitor); |
9109 } | 9116 } |
9110 } | 9117 } |
OLD | NEW |