Bug 416960: [reconcile] cannot resolve tsuper marker ifc in
CalloutToFieldCompletionProposal
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
index 81659e9..0cc4f11 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/BinaryTypeBinding.java
@@ -541,7 +541,7 @@
 			System.arraycopy(oldMembers, 0, newMembers, 0, len);
 			newMembers[len] = this;
 			SourceTypeBinding enclosingSourceTypeBinding = (SourceTypeBinding)this.enclosingType;
-			enclosingSourceTypeBinding.memberTypes = newMembers;
+			enclosingSourceTypeBinding.setMemberTypes(newMembers);
 			if (enclosingSourceTypeBinding.scope != null) {
 				// remember the name of this binary member type:
 				CompilationResult result =
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
index 430496b..214227f 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/ClassScope.java
@@ -866,8 +866,10 @@
 
 			if (!memberTypeDeclaration.isRoleFile()) { // otherwise OTClassScope.buildType() did this.
 				// need to actually add:
-				System.arraycopy(sourceType.memberTypes, 0, sourceType.memberTypes = new ReferenceBinding[size+1], 0, size);
-				sourceType.memberTypes[size]= newBinding;
+				ReferenceBinding[] newMembers = new ReferenceBinding[size+1];
+				System.arraycopy(sourceType.memberTypes, 0, newMembers, 0, size);
+				newMembers[size]= newBinding;
+				sourceType.setMemberTypes(newMembers);
 			}
 		}
 	}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
index f8c6202..6882cdb 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/SourceTypeBinding.java
@@ -3091,6 +3091,10 @@
 	
 	if (!isPrototype())
 		return this.prototype.setMemberTypes(memberTypes);
+//{ObjectTeams: for post-hoc addition need to clear this flag:
+	if (memberTypes.length > 0)
+		this.tagBits &= ~TagBits.HasNoMemberTypes;
+// SH}
 
 	this.memberTypes = memberTypes;
 	if ((this.tagBits & TagBits.HasAnnotatedVariants) != 0) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/OTClassScope.java b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/OTClassScope.java
index 5c6d287..c24b7c7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/OTClassScope.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/objectteams/otdt/internal/core/compiler/lookup/OTClassScope.java
@@ -1,7 +1,7 @@
 /**********************************************************************
  * This file is part of "Object Teams Development Tooling"-Software
  *
- * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany,
+ * Copyright 2004, 2016 Fraunhofer Gesellschaft, Munich, Germany,
  * for its Fraunhofer Institute for Computer Architecture and Software
  * Technology (FIRST), Berlin, Germany and Technical University Berlin,
  * Germany.
@@ -10,7 +10,6 @@
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
  * http://www.eclipse.org/legal/epl-v10.html
- * $Id: OTClassScope.java 23416 2010-02-03 19:59:31Z stephan $
  *
  * Please visit http://www.eclipse.org/objectteams for updates and contact.
  *
@@ -121,16 +120,18 @@
 		}
 		SourceTypeBinding type = super.buildType(enclosingType, packageBinding, accessRestriction);
 		int size = 0;
+		ReferenceBinding[] newMembers;
 		if (enclosingType.memberTypes == null) {
-			enclosingType.memberTypes = new ReferenceBinding[1];
+			newMembers = new ReferenceBinding[1];
 		} else {
 			size = enclosingType.memberTypes.length;
 			//grow Array
 			System.arraycopy(
 					enclosingType.memberTypes, 0,
-					enclosingType.memberTypes = new ReferenceBinding[size+1], 0, size);
+					newMembers = new ReferenceBinding[size+1], 0, size);
 		}
-		enclosingType.memberTypes[size] = type;
+		newMembers[size] = type;
+		enclosingType.setMemberTypes(newMembers);
 		return type;
 	}