瀏覽代碼

+ description of tasnode.call (by Jonas Maebe)

git-svn-id: trunk@15198 -
florian 15 年之前
父節點
當前提交
d0e9a7ead9
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. 11 0
      compiler/ncnv.pas

+ 11 - 0
compiler/ncnv.pas

@@ -189,6 +189,17 @@ interface
        ttypeconvnodeclass = class of ttypeconvnode;
 
        tasnode = class(tbinarynode)
+          { as nodes cannot be translated directly into call nodes bcause:
+
+            When using -CR, explicit class typecasts are replaced with as-nodes to perform
+            class type checking. The problem is that if a typecasted class instance is
+            passed as a var-parameter, then you cannot replace it with a function call. So the as-node
+            a) call the as helper to perform the type checking
+            b) still pass the original instance as parameter to var-parameters
+            (and in general: to return it as the result of the as-node)
+
+            so the call field is required
+          }
           call: tnode;
           constructor create(l,r : tnode);virtual;
           function pass_1 : tnode;override;