<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # Compiler Error CS0173 無法確定條件表達式的類型,因為“class1”和“class2”之間沒有隱式轉換 當希望不同類的對象在同一代碼中使用時,類之間的轉換非常有用。然而,在一起工作的兩個類不能有相互轉換和多余轉換,也不能有隱式轉換。 _class1_ 和 _class2_ 的類型分別確定,選擇更全面的類型作為條件表達式的類型。有關類型的確定方式的更多信息,請參見[Conditional operator cannot cast implicitly](http://go.microsoft.com/fwlink/?LinkId=213999)。 若要解決 CS0173,請確認 _class1_ 與 _class2_ 之間有且僅有一個隱式轉換,而不論向哪個方向進行轉換或在哪個類中進行轉換。有關更多信息,請參見[隱式數值轉換表(C# 參考)](https://msdn.microsoft.com/zh-cn/library/y5b434w4.aspx)和[轉換運算符(C# 編程指南)](https://msdn.microsoft.com/zh-cn/library/09479473.aspx)。 下面的示例生成 CS0173: ``` // CS0173.cs public class C {} public class A { //// The following code defines an implicit conversion operator from //// type C to type A. //public static implicit operator A(C c) //{ // A a = new A(); // a = c; // return a; //} } public class MyClass { public static void F(bool b) { A a = new A(); C c = new C(); // The following line causes CS0173 because there is no implicit // conversion from a to c or from c to a. object o = b ? a : c; // To resolve the error, you can cast a and c. //object o = b ? (object)a : (object)c; // Alternatively, you can add a conversion operator from class C to // class A, or from class A to class C, but not both. } public static void Main() { F(true); } } ``` 下面的代碼在 Visual Studio 2005 中不生成 CS0173,但在更高版本中會生成 CS0173。 ``` //cs0173_2.cs class M { static int Main () { int X = 1; // The following line causes CS0173 in Visual Studio 2005. object o = (X == 0) ? null : null; return -1; } } ```
                  <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>

                              哎呀哎呀视频在线观看