Save transient state
Change-Id: I1c2405b1237b6017a92b789452671938e0c25705
Reviewed-on: https://dart-review.googlesource.com/c/88448
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Peter von der Ahé <ahe@google.com>
diff --git a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
index bcf31d8..1a09336 100644
--- a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
@@ -156,6 +156,8 @@
}
void add(KernelClassBuilder cls) {
+ assert(!hasNoSuchMethod);
+ assert(abstractMemberCount == 0);
if (cls.isPatch) {
// TODO(ahe): What about patch classes. Have we injected patched members
// into the class-builder's scope?
@@ -390,7 +392,13 @@
if (declaration is KernelClassBuilder) {
ClassHierarchyNode node = nodes[declaration];
if (node == null) {
+ bool savedHasNoSuchMethod = hasNoSuchMethod;
+ hasNoSuchMethod = false;
+ int savedAbstractMemberCount = abstractMemberCount;
+ abstractMemberCount = 0;
add(declaration);
+ hasNoSuchMethod = savedHasNoSuchMethod;
+ abstractMemberCount = savedAbstractMemberCount;
node = nodes[declaration];
}
return node;