diff --git a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
index faf12ea64476ffd6be2ccd87e61bf2e5b10e6de2..9ab3bbdc9faf243872669ea224c913ecdf9fec2b 100644
--- a/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
+++ b/src/Compilers/CSharp/Portable/CSharpResources.Designer.cs
@@ -3706,6 +3706,15 @@ internal class CSharpResources {
}
}
+ ///
+ /// Looks up a localized string similar to Cannot update '{0}'; attribute '{1}' is missing..
+ ///
+ internal static string ERR_EncUpdateFailedMissingAttribute {
+ get {
+ return ResourceManager.GetString("ERR_EncUpdateFailedMissingAttribute", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to #endif directive expected.
///
diff --git a/src/Compilers/CSharp/Portable/CSharpResources.resx b/src/Compilers/CSharp/Portable/CSharpResources.resx
index d6e30e5f4cd92bf29110331fd96e6a975f6ab110..884ed285dfd0b435f4d67c44915b413d6aaa660f 100644
--- a/src/Compilers/CSharp/Portable/CSharpResources.resx
+++ b/src/Compilers/CSharp/Portable/CSharpResources.resx
@@ -1646,6 +1646,9 @@ If such a class is used as a base class and if the deriving class defines a dest
The DllImport attribute must be specified on a method marked 'static' and 'extern'
+
+ Cannot update '{0}'; attribute '{1}' is missing.
+
The DllImport attribute cannot be applied to a method that is generic or contained in a generic type.
diff --git a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
index 96b915a33335fb7a98466f1e87abbfb7a9fb3aaf..f2a35a425f5c82416dac0e2538df6452c5a22ebc 100644
--- a/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
+++ b/src/Compilers/CSharp/Portable/Errors/ErrorCode.cs
@@ -1006,17 +1006,17 @@ internal enum ErrorCode
ERR_BadDynamicQuery = 1979,
ERR_DynamicAttributeMissing = 1980,
WRN_IsDynamicIsConfusing = 1981,
- ERR_DynamicNotAllowedInAttribute = 1982, // Replaced by ERR_BadAttributeParamType in Roslyn.
+ //ERR_DynamicNotAllowedInAttribute = 1982, // Replaced by ERR_BadAttributeParamType in Roslyn.
ERR_BadAsyncReturn = 1983,
ERR_BadAwaitInFinally = 1984,
ERR_BadAwaitInCatch = 1985,
ERR_BadAwaitArg = 1986,
ERR_BadAsyncArgType = 1988,
ERR_BadAsyncExpressionTree = 1989,
- ERR_WindowsRuntimeTypesMissing = 1990,
+ //ERR_WindowsRuntimeTypesMissing = 1990, // unused in Roslyn
ERR_MixingWinRTEventWithRegular = 1991,
ERR_BadAwaitWithoutAsync = 1992,
- ERR_MissingAsyncTypes = 1993,
+ //ERR_MissingAsyncTypes = 1993, // unused in Roslyn
ERR_BadAsyncLacksBody = 1994,
ERR_BadAwaitInQuery = 1995,
ERR_BadAwaitInLock = 1996,
diff --git a/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs b/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs
index f91f6fbf24c934ccc2d3fe4ae5269e26af092ade..6c6137f4046a36c52eded797730779bfc7c271ca 100644
--- a/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs
+++ b/src/Compilers/CSharp/Test/Syntax/Diagnostics/DiagnosticTest.cs
@@ -5,15 +5,38 @@
using System.Globalization;
using System.Linq;
using Microsoft.CodeAnalysis.CSharp.Test.Utilities;
+using Microsoft.CodeAnalysis.Emit;
using Microsoft.CodeAnalysis.Text;
using Roslyn.Test.Utilities;
using Xunit;
-using Microsoft.CodeAnalysis.Emit;
namespace Microsoft.CodeAnalysis.CSharp.UnitTests
{
public partial class DiagnosticTest : CSharpTestBase
{
+ ///
+ /// Ensure string resources are included.
+ ///
+ [Fact]
+ public void Resources()
+ {
+ var excludedErrorCodes = new[]
+ {
+ ErrorCode.Void,
+ ErrorCode.Unknown,
+ ErrorCode.WRN_ALinkWarn, // Not reported, but retained to allow configuring class of related warnings. See CSharpDiagnosticFilter.Filter.
+ };
+ foreach (ErrorCode code in Enum.GetValues(typeof(ErrorCode)))
+ {
+ if (Array.IndexOf(excludedErrorCodes, code) >= 0)
+ {
+ continue;
+ }
+ var message = ErrorFacts.GetMessage(code, CultureInfo.InvariantCulture);
+ Assert.False(string.IsNullOrEmpty(message));
+ }
+ }
+
[Fact]
public void TestDiagnostic()
{
diff --git a/src/Compilers/VisualBasic/Portable/Errors/Errors.vb b/src/Compilers/VisualBasic/Portable/Errors/Errors.vb
index 2587a1d6279b86eb7828e73f367c1d79419beaa2..9a414b0014b1952daead45d3155c611cb8f70526 100644
--- a/src/Compilers/VisualBasic/Portable/Errors/Errors.vb
+++ b/src/Compilers/VisualBasic/Portable/Errors/Errors.vb
@@ -1451,7 +1451,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_MultilineLambdasCannotContainOnError = 36668
'ERR_BranchOutOfMultilineLambda = 36669 obsolete - was not even reported in Dev10 any more.
ERR_LambdaBindingMismatch2 = 36670
- ERR_MultilineLambdaShadowLocal1 = 36671
+ 'ERR_MultilineLambdaShadowLocal1 = 36671 'unused in Roslyn
ERR_StaticInLambda = 36672
ERR_MultilineLambdaMissingSub = 36673
ERR_MultilineLambdaMissingFunction = 36674
@@ -1468,7 +1468,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_OverloadCandidate1 = 36712
ERR_AutoPropertyInitializedInStructure = 36713
ERR_InitializedExpandedProperty = 36714
- ERR_NewExpandedProperty = 36715
+ 'ERR_NewExpandedProperty = 36715 'unused in Roslyn
ERR_LanguageVersion = 36716
ERR_ArrayInitNoType = 36717
@@ -1545,7 +1545,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_CannotUseGenericBaseTypeAcrossAssemblyBoundaries = 36925
ERR_BadAsyncByRefParam = 36926
ERR_BadIteratorByRefParam = 36927
- ERR_BadAsyncExpressionLambda = 36928
+ 'ERR_BadAsyncExpressionLambda = 36928 'unused in Roslyn
ERR_BadAsyncInQuery = 36929
ERR_BadGetAwaiterMethod1 = 36930
'ERR_ExpressionTreeContainsAwait = 36931
@@ -1561,7 +1561,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
'// unused 36941
ERR_BadReturnValueInIterator = 36942
ERR_BadAwaitInTryHandler = 36943
- ERR_BadAwaitObject = 36944
+ 'ERR_BadAwaitObject = 36944 'unused in Roslyn
ERR_BadAsyncReturn = 36945
ERR_BadResumableAccessReturnVariable = 36946
ERR_BadIteratorExpressionLambda = 36947
@@ -1570,7 +1570,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_ConstructorAsync = 36950
ERR_InvalidLambdaModifier = 36951
ERR_ReturnFromNonGenericTaskAsync = 36952
- ERR_BadAutoPropertyFlags1 = 36953
+ 'ERR_BadAutoPropertyFlags1 = 36953 'unused in Roslyn
ERR_BadOverloadCandidates2 = 36954
ERR_BadStaticInitializerInResumable = 36955
@@ -1696,9 +1696,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
ERR_RefReturningCallInExpressionTree = 37263
- ERR_LastPlusOne
-
-
'// WARNINGS BEGIN HERE
WRN_UseOfObsoleteSymbol2 = 40000
WRN_MustOverloadBase4 = 40003
diff --git a/src/Compilers/VisualBasic/Portable/VBResources.Designer.vb b/src/Compilers/VisualBasic/Portable/VBResources.Designer.vb
index 80d1e76345b941f550428a36dcf940e43b4c8b83..3ed01472216f53cace5977eed9bbd59dfc88d12e 100644
--- a/src/Compilers/VisualBasic/Portable/VBResources.Designer.vb
+++ b/src/Compilers/VisualBasic/Portable/VBResources.Designer.vb
@@ -954,6 +954,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
+ '''
+ ''' Looks up a localized string similar to Algorithm '{0}' is not supported.
+ '''
+ Friend ReadOnly Property ERR_BadChecksumAlgorithm() As String
+ Get
+ Return ResourceManager.GetString("ERR_BadChecksumAlgorithm", resourceCulture)
+ End Get
+ End Property
+
'''
''' Looks up a localized string similar to Classes cannot be declared '{0}'..
'''
@@ -9829,6 +9838,15 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
End Get
End Property
+ '''
+ ''' Looks up a localized string similar to /sourcelink switch is only supported when emitting Portable PDB (/debug:portable or /debug:embedded must be specified)..
+ '''
+ Friend ReadOnly Property ERR_SourceLinkRequiresPortablePdb() As String
+ Get
+ Return ResourceManager.GetString("ERR_SourceLinkRequiresPortablePdb", resourceCulture)
+ End Get
+ End Property
+
'''
''' Looks up a localized string similar to Specifiers and attributes are not valid on this statement..
'''
diff --git a/src/Compilers/VisualBasic/Portable/VBResources.resx b/src/Compilers/VisualBasic/Portable/VBResources.resx
index 00bbc09f0cd4f8efdc33861c4df2140a106ccb4d..17cb17d67bc917551a1ee9cfe3a36864a9bc7a0a 100644
--- a/src/Compilers/VisualBasic/Portable/VBResources.resx
+++ b/src/Compilers/VisualBasic/Portable/VBResources.resx
@@ -198,6 +198,9 @@
Command-line syntax error: Missing Guid for option '{1}'
+
+ Algorithm '{0}' is not supported
+
unrecognized option '{0}'; ignored
@@ -5369,6 +5372,9 @@
Option '{0}' must be an absolute path.
+
+ /sourcelink switch is only supported when emitting Portable PDB (/debug:portable or /debug:embedded must be specified).
+
Tuple member names must be unique.
diff --git a/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj b/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj
index 5df7dcb41a649e71b6fb50a926eeaeae4c1a581a..832a1848937f75ff8cbafd00633d98b1151d9c87 100644
--- a/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj
+++ b/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj
@@ -113,6 +113,7 @@
+
@@ -231,4 +232,4 @@
-
+
\ No newline at end of file
diff --git a/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/DiagnosticTests.vb b/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/DiagnosticTests.vb
new file mode 100644
index 0000000000000000000000000000000000000000..4316157fc5a13c9510d59f6c317070701792bea7
--- /dev/null
+++ b/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/DiagnosticTests.vb
@@ -0,0 +1,35 @@
+' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+Imports System.Globalization
+
+Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests
+
+ Public Class DiagnosticTests
+ Inherits BasicTestBase
+
+ '''
+ ''' Ensure string resources are included.
+ '''
+
+ Public Sub Resources()
+ Dim excludedIds = {
+ ERRID.Void,
+ ERRID.Unknown,
+ ERRID.ERR_None,
+ ERRID.ERR_CannotUseGenericBaseTypeAcrossAssemblyBoundaries ' Not reported. See ImportsBinder.ShouldReportUseSiteErrorForAlias.
+ }
+ For Each id As ERRID In [Enum].GetValues(GetType(ERRID))
+ If id >= ERRID.ERRWRN_Last Then
+ Continue For
+ End If
+ If Array.IndexOf(excludedIds, id) >= 0 Then
+ Continue For
+ End If
+ Dim message = ErrorFactory.IdToString(id, CultureInfo.InvariantCulture)
+ Assert.False(String.IsNullOrEmpty(message))
+ Next
+ End Sub
+
+ End Class
+
+End Namespace
\ No newline at end of file