提交 4f8ce5b7 编写于 作者: V vsadov

PR feedback

上级 2e351ba3
......@@ -5579,7 +5579,7 @@ internal class CSharpResources {
}
/// <summary>
/// Looks up a localized string similar to Variadic member &apos;{0}&apos; cannot implement interface member &apos;{1}&apos; in type &apos;{2}&apos;. Use an explicit interface implementation..
/// Looks up a localized string similar to &apos;{0}&apos; cannot implement interface member &apos;{1}&apos; in type &apos;{2}&apos; because it has an __arglist parameter..
/// </summary>
internal static string ERR_InterfaceImplementedImplicitlyByVariadic {
get {
......
......@@ -1756,7 +1756,7 @@ If such a class is used as a base class and if the deriving class defines a dest
<value>Conditional member '{0}' cannot implement interface member '{1}' in type '{2}'</value>
</data>
<data name="ERR_InterfaceImplementedImplicitlyByVariadic" xml:space="preserve">
<value>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</value>
<value>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</value>
</data>
<data name="ERR_IllegalRefParam" xml:space="preserve">
<value>ref and out are not valid in this context</value>
......
......@@ -8596,8 +8596,8 @@ Pokud chcete odstranit toto varování, můžete místo toho použít /reference
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Um die Warnung zu beheben, können Sie stattdessen /reference verwenden (Einbett
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Para eliminar la advertencia puede usar /reference (establezca la propiedad Embe
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Pour supprimer l'avertissement, vous pouvez utiliser la commande /reference (dé
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Per rimuovere l'avviso, è invece possibile usare /reference (impostare la propr
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Aby usunąć ostrzeżenie, możesz zamiast tego użyć opcji /reference (ustaw w
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Para incorporar informações de tipo de interoperabilidade para os dois assembl
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ Uyarıyı kaldırmak için, /reference kullanabilirsiniz (Birlikte Çalışma T
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -8596,8 +8596,8 @@ To remove the warning, you can use /reference instead (set the Embed Interop Typ
<note />
</trans-unit>
<trans-unit id="ERR_InterfaceImplementedImplicitlyByVariadic">
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.</target>
<source>'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</source>
<target state="new">'{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter</target>
<note />
</trans-unit>
</body>
......
......@@ -13369,19 +13369,71 @@ public static void Main()
var comp = CreateStandardCompilation(code, references: new[] { reference.ToMetadataReference() });
comp.VerifyDiagnostics(
// (7,28): error CS0630: 'VarArgs.Invoke(__arglist)' cannot implement interface member 'IVarArgs.Invoke(__arglist)' in type 'MyVarArgs' because it has an __arglist parameter. Use an explicit interface implementation.
// (7,28): error CS0630: 'VarArgs.Invoke(__arglist)' cannot implement interface member 'IVarArgs.Invoke(__arglist)' in type 'MyVarArgs' because it has an __arglist parameter.
// class MyVarArgs : VarArgs, IVarArgs
Diagnostic(ErrorCode.ERR_InterfaceImplementedImplicitlyByVariadic, "IVarArgs").WithArguments("VarArgs.Invoke(__arglist)", "IVarArgs.Invoke(__arglist)", "MyVarArgs").WithLocation(7, 28)
);
comp = CreateStandardCompilation(code, references: new[] { reference.EmitToImageReference() });
comp.VerifyDiagnostics(
// (7,28): error CS0630: 'VarArgs.Invoke(__arglist)' cannot implement interface member 'IVarArgs.Invoke(__arglist)' in type 'MyVarArgs' because it has an __arglist parameter. Use an explicit interface implementation.
// (7,28): error CS0630: 'VarArgs.Invoke(__arglist)' cannot implement interface member 'IVarArgs.Invoke(__arglist)' in type 'MyVarArgs' because it has an __arglist parameter.
// class MyVarArgs : VarArgs, IVarArgs
Diagnostic(ErrorCode.ERR_InterfaceImplementedImplicitlyByVariadic, "IVarArgs").WithArguments("VarArgs.Invoke(__arglist)", "IVarArgs.Invoke(__arglist)", "MyVarArgs").WithLocation(7, 28)
);
}
[WorkItem(24348, "https://github.com/dotnet/roslyn/issues/24348")]
[ClrOnlyFact(ClrOnlyReason.Ilasm)]
public void VarargBridgeSourceModopt()
{
var il = @"
.class interface public auto ansi abstract IVarArgs
{
// Methods
.method public hidebysig newslot abstract virtual
instance vararg int32 modopt(int64) Invoke () cil managed
{
} // end of method IVarArgs::Invoke
} // end of class IVarArgs
";
var reference = CompileIL(il);
var code = @"
public class VarArgs
{
public int Invoke(__arglist) => throw null;
}
class MyVarArgs : VarArgs, IVarArgs
{
}
public static class P
{
public static void Main()
{
IVarArgs iv = new MyVarArgs();
iv.Invoke(__arglist(1, 2, 3, 4));
}
}
";
var comp = CreateStandardCompilation(code, references: new[] { reference});
comp.VerifyDiagnostics(
// (8,28): error CS0630: 'VarArgs.Invoke(__arglist)' cannot implement interface member 'IVarArgs.Invoke(__arglist)' in type 'MyVarArgs' because it has an __arglist parameter.
// class MyVarArgs : VarArgs, IVarArgs
Diagnostic(ErrorCode.ERR_InterfaceImplementedImplicitlyByVariadic, "IVarArgs").WithArguments("VarArgs.Invoke(__arglist)", "IVarArgs.Invoke(__arglist)", "MyVarArgs").WithLocation(8, 28)
);
}
[WorkItem(530067, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/530067")]
[Fact]
public void NopAfterCall()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册