Selaa lähdekoodia

Don't cast unless explicitly told to do so.

woollybah 11 vuotta sitten
vanhempi
commit
0f458a58a0
1 muutettua tiedostoa jossa 3 lisäystä ja 3 poistoa
  1. 3 3
      expr.bmx

+ 3 - 3
expr.bmx

@@ -865,8 +865,8 @@ Type TCastExpr Extends TExpr
 				'if both objects or both non-objects...
 				If (TObjectType(ty)<>Null)=(TObjectType(src)<>Null) exprType=ty
 
-			Else
-				If (TObjectType(ty)<>Null) And (TObjectType(src)<>Null) exprType=ty
+			'Else ' if not explicitly cast, we can't just auto-cast it ourselves here.
+				'If (TObjectType(ty)<>Null) And (TObjectType(src)<>Null) exprType=ty
 			EndIf
 
 		EndIf
@@ -1748,7 +1748,7 @@ Type TIdentExpr Extends TExpr
 				If Not static And (TInvokeExpr( expr ) Or TInvokeMemberExpr( expr )) Return New TStmtExpr.Create( New TExprStmt.Create( expr ),cexpr ).Semant()
 				Return cexpr.Semant()
 
-			Else If TFieldDecl( vdecl )
+			Else If TFieldDecl( vdecl ) 
 				If static Err "Field '"+ident+"' cannot be accessed from here."
 				If expr Return New TMemberVarExpr.Create( expr,TVarDecl( vdecl ) ).Semant()
 '				If expr Return New TMemberVarExpr.Create( expr,TVarDecl( vdecl ) ).Semant()