Explorar o código

Fixed more imported generics issues.

woollybah %!s(int64=6) %!d(string=hai) anos
pai
achega
8c11f3d66d
Modificáronse 2 ficheiros con 16 adicións e 5 borrados
  1. 12 1
      decl.bmx
  2. 4 4
      stmt.bmx

+ 12 - 1
decl.bmx

@@ -689,6 +689,9 @@ Type TArgDecl Extends TLocalDecl
 
 	Method OnSemant()
 		Super.OnSemant()
+		If ty Then
+			ty = ty.Semant()
+		End If
 		If init And Not TConstExpr(init) Then
 			If TCastExpr(init) Then
 				If TConstExpr(TCastExpr(init).expr) Or TNullExpr(TCastExpr(init).expr) Then
@@ -2061,6 +2064,8 @@ Type TFuncDecl Extends TBlockDecl
 			End If
 		End If
 		
+		retType = retType.Semant()
+		
 		If TArrayType( retType ) And Not retType.EqualsType( retType.ActualType() )
 '			Err "Return type cannot be an array of generic objects."
 		EndIf
@@ -2547,7 +2552,13 @@ End Rem
 		For Local inst:TClassDecl=EachIn instances
 			Local equal:Int=True
 			For Local i:Int=0 Until args.Length
-				If Not inst.instArgs[i].EqualsType( instArgs[i] )
+				Local instArg:TType = inst.instArgs[i].Semant()
+				inst.instArgs[i] = instArg
+				
+				Local otherInstArg:TType = instArgs[i].Semant()
+				instArgs[i] = otherInstArg
+				
+				If Not instArg.EqualsType( otherInstArg )
 					equal=False
 					Exit
 				EndIf

+ 4 - 4
stmt.bmx

@@ -272,20 +272,20 @@ Type TReturnStmt Extends TStmt
 				TIdentExpr(expr).isRhs = True
 			End If
 			If fdecl.IsCtor() Err "Constructors may not return a value."
-			If TVoidType( fdecl.retType ) Then
+			If TVoidType( fRetType ) Then
 				Local errorText:String = "Function can not return a value."
 				If Not _env.ModuleScope().IsSuperStrict() Then
 					errorText :+ " You may have Strict type overriding SuperStrict type."
 				End If
 				Err errorText
 			End If
-			expr=expr.SemantAndCast( fdecl.retType )
+			expr=expr.SemantAndCast( fRetType  )
 			If TIdentTypeExpr(expr) Err "Function must return a value."
 		Else If fdecl.IsCtor()
 			expr=New TSelfExpr.Semant()
-		Else If Not TVoidType( fdecl.retType )
+		Else If Not TVoidType( fRetType  )
 			If _env.ModuleScope().IsSuperStrict() Err "Function must return a value"
-			expr=New TConstExpr.Create( fdecl.retType,"" ).Semant()
+			expr=New TConstExpr.Create( fRetType ,"" ).Semant()
 		EndIf
 	End Method