<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                和不安全轉換(第5.23.1節)不同,一個失敗的轉換的運行時行為在安全轉換中被定義: > Unlike unsafe casts(5.23.1),the runtime behavior in case of a failing cast is de?ned for safe casts: ~~~ class Base { public function new() { } } class Child1 extends Base {} class Child2 extends Base {} class Main { public static function main() { var child1:Base = new Child1(); var child2:Base = new Child2(); cast(child1, Base); // Exception: Class cast error cast(child1, Child2); } } ~~~ 在這個例子中,我們首先轉換一個Child1類的實例為Base,因為Child1是一個Base的子類(第2.3.2節),所以轉換成功。然后嘗試轉換同樣的類實例為 Child2,這是不被允許的,因為Child2的實例并不是Child1類型的。 > In this example we ?rst cast a class instance of type Child1 to Base,which succeeds because Child1 is a child class (2.3.2) of Base. We then try to cast the same class instance to Child2, which is not allowed because instances of Child2 are not instances of Child1. Haxe編譯器保證一個String類型的異常,在這種情況被拋出(第5.22節)。這個異常可以使用 try/catch 塊捕捉到。 > The Haxe compiler guarantees that an exception of type String is thrown(5.22) in this case. This exception can be caught using a try/catch block (5.18). 安全轉換有一個運行時的開銷。理解編譯器已經發生了類型檢查是很重要的,所以添加手動的檢查是冗余的,例如,使用 Std.is 。預期的使用是try安全轉換,然后捕捉String類型的異常。 > Safe casts have a runtime overhead. It is important to understand that the compiler already generates type checks,so it is redundant to add manual checks,e.g. usingStd.is. The intended usage is to try the safe cast and catch the String exception.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看