private void CheckIfValidExtensionOfSuperType(){
this.GetIRForSuperType();
ClassScope csc = this.superIR as ClassScope;
if (csc != null){
if (this.IsStatic){
if (!csc.owner.IsStatic){
this.superTypeExpression.context.HandleError(JSError.NestedInstanceTypeCannotBeExtendedByStatic);
this.superIR = Typeob.Object;
this.superTypeExpression = null;
}
}else{
if (!csc.owner.IsStatic && this.enclosingScope != csc.owner.enclosingScope){
this.superTypeExpression.context.HandleError(JSError.NestedInstanceTypeCannotBeExtendedByStatic);
this.superIR = Typeob.Object;
this.superTypeExpression = null;
}
}
}
this.GetSuperTypeMembers();
this.GetStartIndexForEachName();
bool checkCLSCompliance = this.NeedsToBeCheckedForCLSCompliance();
if (checkCLSCompliance)
this.CheckMemberNamesForCLSCompliance();
//First check only the methods the implement interfaces
for (int i = 0, n = this.fields.Length; i < n; i++){
JSMemberField field = this.fields[i];
if (field.IsLiteral){
Object value = field.value;
if (value is FunctionObject){
JSMemberField startMethod = field;
while(true){
FunctionObject func = (FunctionObject)value;
if (func.implementedIface == null) break;
this.CheckMethodDeclarationConsistency(func);
if (func.implementedIfaceMethod == null)
func.funcContext.HandleError(JSError.NoMethodInBaseToOverride);
if (field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly)
func.CheckCLSCompliance(checkCLSCompliance);
field = field.nextOverload;
if (field == null) break;
value = field.value;
}
continue;
}else if (value is JSProperty){
continue;
}
}
}
for (int i = 0, n = this.fields.Length; i < n; i++){
JSMemberField field = this.fields[i];
if (field.IsLiteral){
Object value = field.value;
if (value is FunctionObject){
JSMemberField startMethod = field;
while(true){
FunctionObject func = (FunctionObject)value;
if (func.implementedIface != null) break;
this.CheckMethodDeclarationConsistency(func);
if (field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly)
func.CheckCLSCompliance(checkCLSCompliance);
field = field.nextOverload;
if (field == null) break;
value = field.value;
}
continue;
}else if (value is JSProperty){
continue;
}
}
this.CheckFieldDeclarationConsistency(field);
if (field.IsPublic || field.IsFamily || field.IsFamilyOrAssembly)
field.CheckCLSCompliance(checkCLSCompliance);
}
}