소스 검색

Only a cast if there's not already an expression.

Brucey 5 년 전
부모
커밋
2c01f69140
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      expr.bmx

+ 6 - 4
expr.bmx

@@ -3042,10 +3042,12 @@ Type TIdentExpr Extends TExpr
 		'	If cdecl Return args[0].Cast( New TObjectType.Create(cdecl),CAST_EXPLICIT )
 		'EndIf
 
-		Local ty:TType=scope.FindType( IdentLower(),Null )
-		If ty Then
-			If args.Length=1 And args[0] Return args[0].Cast( ty,CAST_EXPLICIT )
-			Err "Illegal number of arguments for type conversion"
+		If Not expr Then
+			Local ty:TType=scope.FindType( IdentLower(),Null )
+			If ty Then
+				If args.Length=1 And args[0] Return args[0].Cast( ty,CAST_EXPLICIT )
+				Err "Illegal number of arguments for type conversion"
+			End If
 		End If
 
 		If throwError Then