forked from Banani-Rath/docs.ja-jp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
375 changed files
with
18,636 additions
and
9,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,66 @@ | ||
--- | ||
title: "コンパイラ エラー CS0072 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0072" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0072" | ||
--- | ||
title: "コンパイラ エラー CS0072" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0072 | ||
helpviewer_keywords: CS0072 | ||
ms.assetid: 9153cd52-f497-4128-a11f-a2820218b0e6 | ||
caps.latest.revision: 8 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 8 | ||
--- | ||
# コンパイラ エラー CS0072 | ||
caps.latest.revision: "8" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: c556a92cb5b926796ac95068db384b0a74252266 | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-error-cs0072"></a>コンパイラ エラー CS0072 | ||
'event' : オーバーライドできません。'method' はイベントではありません | ||
|
||
[イベント](../../csharp/language-reference/keywords/event.md)は別のイベントのみをオーバーライドできます。 詳細については、「[イベント](../../csharp/programming-guide/events/index.md)」を参照してください。 | ||
[イベント](../../csharp/language-reference/keywords/event.md) は別のイベントのみをオーバーライドできます。 詳細については、「[イベント](../../csharp/programming-guide/events/index.md)」を参照してください。 | ||
|
||
次の例では CS0072 が生成されます。 | ||
|
||
``` | ||
// CS0072.cs delegate void MyDelegate(); class Test1 { public virtual event MyDelegate MyEvent; public virtual void VMeth() { } public void FireAway() { if (MyEvent != null) MyEvent(); } } class Test2 : Test1 { public override event MyDelegate VMeth // CS0072 // uncomment the following lines to resolve // public override event MyDelegate MyEvent { add { VMeth += value; // MyEvent += value; } remove { VMeth -= value; // MyEvent -= value; } } public static void Main() { } } | ||
``` | ||
// CS0072.cs | ||
delegate void MyDelegate(); | ||
class Test1 | ||
{ | ||
public virtual event MyDelegate MyEvent; | ||
public virtual void VMeth() | ||
{ | ||
} | ||
public void FireAway() | ||
{ | ||
if (MyEvent != null) | ||
MyEvent(); | ||
} | ||
} | ||
class Test2 : Test1 | ||
{ | ||
public override event MyDelegate VMeth // CS0072 | ||
// uncomment the following lines to resolve | ||
// public override event MyDelegate MyEvent | ||
{ | ||
add | ||
{ | ||
VMeth += value; | ||
// MyEvent += value; | ||
} | ||
remove | ||
{ | ||
VMeth -= value; | ||
// MyEvent -= value; | ||
} | ||
} | ||
public static void Main() | ||
{ | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,45 @@ | ||
--- | ||
title: "コンパイラの警告 (レベル 4) CS0078 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0078" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0078" | ||
--- | ||
title: "コンパイラの警告 (レベル 4) CS0078" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0078 | ||
helpviewer_keywords: CS0078 | ||
ms.assetid: 8d637be6-82bc-462c-bec5-217327bc8c40 | ||
caps.latest.revision: 6 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 6 | ||
--- | ||
# コンパイラの警告 (レベル 4) CS0078 | ||
caps.latest.revision: "6" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: b9db263df282606b4c9602d894db11fd3aad44d1 | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-warning-level-4-cs0078"></a>コンパイラの警告 (レベル 4) CS0078 | ||
'l' と 数字の '1' との混同を避けるため、'L' を使用してください。 | ||
|
||
大文字の L ではなく小文字の l を使用する long 型へのキャストを検出すると、コンパイラによって警告が出されます。 | ||
|
||
次の例では CS0078 が生成されます。 | ||
|
||
``` | ||
// CS0078.cs // compile with: /W:4 class test { public static void TestL(long i) { } public static void TestL(int i) { } public static void Main() { TestL(25l); // CS0078 // try the following line instead // TestL(25L); } } | ||
``` | ||
// CS0078.cs | ||
// compile with: /W:4 | ||
class test { | ||
public static void TestL(long i) | ||
{ | ||
} | ||
public static void TestL(int i) | ||
{ | ||
} | ||
public static void Main() | ||
{ | ||
TestL(25l); // CS0078 | ||
// try the following line instead | ||
// TestL(25L); | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,50 @@ | ||
--- | ||
title: "コンパイラの警告 (レベル 1) CS0612 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0612" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0612" | ||
--- | ||
title: "コンパイラの警告 (レベル 1) CS0612" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0612 | ||
helpviewer_keywords: CS0612 | ||
ms.assetid: 7695f3b7-ffef-43f7-83db-fc1a9e361f1a | ||
caps.latest.revision: 7 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 7 | ||
--- | ||
# コンパイラの警告 (レベル 1) CS0612 | ||
caps.latest.revision: "7" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: 6e1f15411f47119f55015e305bca02c146e490f6 | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-warning-level-1-cs0612"></a>コンパイラの警告 (レベル 1) CS0612 | ||
'member' は使用されなくなりました | ||
|
||
クラス デザイナーによってメンバーが [Obsolete](http://msdn.microsoft.com/ja-jp/05e99cd0-bda6-4f79-a890-1ca093b4b488) 属性でマークされました。 つまり、クラスの将来のバージョンでこのメンバーがサポートされない可能性があります。 | ||
クラス デザイナーによってメンバーが [Obsolete](http://msdn.microsoft.com/en-us/05e99cd0-bda6-4f79-a890-1ca093b4b488) 属性でマークされました。 つまり、クラスの将来のバージョンでこのメンバーがサポートされない可能性があります。 | ||
|
||
次の例では、旧式のメンバーにアクセスするとどのように CS0612 が生成されるかを示しています。 | ||
|
||
``` | ||
// CS0612.cs // compile with: /W:1 using System; class MyClass { [Obsolete] public static void ObsoleteMethod() { } [Obsolete] public static int ObsoleteField; } class MainClass { static public void Main() { MyClass.ObsoleteMethod(); // CS0612 here: method is deprecated MyClass.ObsoleteField = 0; // CS0612 here: field is deprecated } } | ||
``` | ||
// CS0612.cs | ||
// compile with: /W:1 | ||
using System; | ||
class MyClass | ||
{ | ||
[Obsolete] | ||
public static void ObsoleteMethod() | ||
{ | ||
} | ||
[Obsolete] | ||
public static int ObsoleteField; | ||
} | ||
class MainClass | ||
{ | ||
static public void Main() | ||
{ | ||
MyClass.ObsoleteMethod(); // CS0612 here: method is deprecated | ||
MyClass.ObsoleteField = 0; // CS0612 here: field is deprecated | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
--- | ||
title: "コンパイラ エラー CS0694 | Microsoft Docs" | ||
ms.date: "2015-07-20" | ||
ms.prod: ".net" | ||
ms.technology: | ||
- "devlang-csharp" | ||
ms.topic: "article" | ||
f1_keywords: | ||
- "CS0694" | ||
dev_langs: | ||
- "CSharp" | ||
helpviewer_keywords: | ||
- "CS0694" | ||
--- | ||
title: "コンパイラ エラー CS0694" | ||
ms.date: 07/20/2015 | ||
ms.prod: .net | ||
ms.technology: devlang-csharp | ||
ms.topic: article | ||
f1_keywords: CS0694 | ||
helpviewer_keywords: CS0694 | ||
ms.assetid: 048615e4-4599-4726-b5db-55322ccc936f | ||
caps.latest.revision: 8 | ||
author: "BillWagner" | ||
ms.author: "wiwagn" | ||
caps.handback.revision: 8 | ||
--- | ||
# コンパイラ エラー CS0694 | ||
caps.latest.revision: "8" | ||
author: BillWagner | ||
ms.author: wiwagn | ||
ms.openlocfilehash: 79acfefded58c4b6898f63d8b9c8b4d222911a9c | ||
ms.sourcegitcommit: bd1ef61f4bb794b25383d3d72e71041a5ced172e | ||
ms.translationtype: MT | ||
ms.contentlocale: ja-JP | ||
ms.lasthandoff: 10/18/2017 | ||
--- | ||
# <a name="compiler-error-cs0694"></a>コンパイラ エラー CS0694 | ||
型パラメーター 'identifier' には含んでいる型またはメソッドと同じ名前が付いています | ||
|
||
型パラメーターの名前は、その型パラメーターを含む型またはメソッドの名前と同じにすることはできないため、型パラメーターに別の名前を使用する必要があります。 | ||
|
||
## 使用例 | ||
## <a name="example"></a>例 | ||
次の例では CS0694 が生成されます。 | ||
|
||
``` | ||
// CS0694.cs // compile with: /target:library class C<C> {} // CS0694 | ||
// CS0694.cs | ||
// compile with: /target:library | ||
class C<C> {} // CS0694 | ||
``` | ||
|
||
## 使用例 | ||
## <a name="example"></a>例 | ||
ジェネリック クラスを含む上記のケースに加えて、次のメソッドでも、このエラーが発生する可能性があります。 | ||
|
||
``` | ||
// CS0694_2.cs // compile with: /target:library class A { public void F<F>(F arg); // CS0694 } | ||
``` | ||
// CS0694_2.cs | ||
// compile with: /target:library | ||
class A | ||
{ | ||
public void F<F>(F arg); // CS0694 | ||
} | ||
``` |
Oops, something went wrong.