Ver Fonte

ImplementsInterface() should check hierarchy. Fixes #294.

woollybah há 8 anos atrás
pai
commit
b4dc07113c
2 ficheiros alterados com 10 adições e 0 exclusões
  1. 6 0
      decl.bmx
  2. 4 0
      parser.bmx

+ 6 - 0
decl.bmx

@@ -3018,6 +3018,12 @@ End Rem
 				Return True
 			End If
 		Next
+		
+		' check hierarchy
+		If superClass Then
+			Return superClass.ImplementsInterface(ident)
+		End If
+		
 		Return False
 	End Method
 	

+ 4 - 0
parser.bmx

@@ -177,6 +177,10 @@ Type TForEachinStmt Extends TLoopStmt
 		Else If TObjectType( expr.exprType )
 			Local tmpDecl:TDeclStmt
 			Local iterable:Int
+
+			' ensure semanted
+			TObjectType(expr.exprType).classDecl.Semant()
+			
 			If TObjectType(expr.exprType).classDecl.ImplementsInterface("iiterable") Then
 				iterable = True
 			End If