diff --git a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
index ad4ccc32a129de7d3122e5f850686b19ea27a355..38c4abc96806d73df060752debf7032d0fc2e68e 100644
--- a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
+++ b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
@@ -5578,6 +5578,15 @@ internal class CSharpResources {
}
}
+ ///
+ /// Looks up a localized string similar to Variadic member '{0}' cannot implement interface member '{1}' in type '{2}'. Use an explicit interface implementation..
+ ///
+ internal static string ERR_InterfaceImplementedImplicitlyByVariadic {
+ get {
+ return ResourceManager.GetString("ERR_InterfaceImplementedImplicitlyByVariadic", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to '{0}': interface members cannot have a definition.
///
diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx
index 610aafe8f742657881f72a02b213ace99162cae1..1e7ad99c6fc368d3a49ac2627fdaf73e364745cd 100644
--- a/src/Compilers/CSharp/Portable/CSharpResources.resx
+++ b/src/Compilers/CSharp/Portable/CSharpResources.resx
@@ -1755,6 +1755,9 @@ If such a class is used as a base class and if the deriving class defines a dest
Conditional member '{0}' cannot implement interface member '{1}' in type '{2}'
+
+ '{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.
+
ref and out are not valid in this context
diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
index 358b6c6d05ff897c95dd3c99d8c2b1a7d0bee723..5c88b9f6dd496393301810784746c6242d72f266 100644
--- a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
+++ b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
@@ -427,6 +427,7 @@ internal enum ErrorCode
WRN_ExternMethodNoImplementation = 626,
WRN_ProtectedInSealed = 628,
ERR_InterfaceImplementedByConditional = 629,
+ ERR_InterfaceImplementedImplicitlyByVariadic = 630,
ERR_IllegalRefParam = 631,
ERR_BadArgumentToAttribute = 633,
//ERR_MissingComTypeOrMarshaller = 635,
diff --git a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol_ImplementationChecks.cs b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol_ImplementationChecks.cs
index 17eb7de3c54175dcc4f596aeb727962ae5cb88f1..759eac16576b48fa82e2aa8d9e1e1c104165b6b7 100644
--- a/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol_ImplementationChecks.cs
+++ b/src/Compilers/CSharp/Portable/Symbols/Source/SourceMemberContainerSymbol_ImplementationChecks.cs
@@ -141,7 +141,16 @@ private void CheckAbstractClassImplementations(DiagnosticBag diagnostics)
if ((object)synthesizedImplementation != null)
{
- synthesizedImplementations.Add(synthesizedImplementation);
+ if (synthesizedImplementation.IsVararg)
+ {
+ diagnostics.Add(
+ ErrorCode.ERR_InterfaceImplementedImplicitlyByVariadic,
+ GetImplicitImplementationDiagnosticLocation(interfaceMember, this, implementingMember), implementingMember, interfaceMember, this);
+ }
+ else
+ {
+ synthesizedImplementations.Add(synthesizedImplementation);
+ }
}
if (wasImplementingMemberFound && interfaceMemberKind == SymbolKind.Event)
diff --git a/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs b/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs
index be19e421cc4f86a794d198c5b34bf644cf86759c..e8a5121f6f5bd37417004e6681a3309c7d56a50e 100644
--- a/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs
+++ b/src/Compilers/CSharp/Portable/Symbols/TypeSymbol.cs
@@ -1213,7 +1213,7 @@ private static void ReportAnyMismatchedConstraints(MethodSymbol interfaceMethod,
}
}
- private static Location GetImplicitImplementationDiagnosticLocation(Symbol interfaceMember, TypeSymbol implementingType, Symbol member)
+ internal static Location GetImplicitImplementationDiagnosticLocation(Symbol interfaceMember, TypeSymbol implementingType, Symbol member)
{
if (member.ContainingType == implementingType)
{
diff --git a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
index 8578247af0144824791aacbc2d997d3424cb9bfa..10ef433e0e3f8fe16f3b520fa12c904a2d402a95 100644
--- a/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
+++ b/src/Compilers/CSharp/Portable/xlf/CSharpResources.cs.xlf
@@ -8595,6 +8595,11 @@ Pokud chcete odstranit toto varování, můžete místo toho použít /reference
ref conditional expression
+
+ '{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.
+ '{0}' cannot implement interface member '{1}' in type '{2}' because it has an __arglist parameter. Use an explicit interface implementation.
+
+