Преглед на файлове

Don't cast unless explicitly told to do so.

woollybah преди 11 години
родител
ревизия
0f458a58a0
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  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()