[347188] Check referenced assemblies for localized culture
authorMarek Safar <marek.safar@gmail.com>
Wed, 30 Mar 2011 11:01:02 +0000 (12:01 +0100)
committerMarek Safar <marek.safar@gmail.com>
Wed, 30 Mar 2011 17:25:03 +0000 (18:25 +0100)
mcs/errors/CS1607-3-lib.cs [new file with mode: 0644]
mcs/errors/Makefile
mcs/errors/cs1607-3.cs [new file with mode: 0644]
mcs/mcs/assembly.cs

diff --git a/mcs/errors/CS1607-3-lib.cs b/mcs/errors/CS1607-3-lib.cs
new file mode 100644 (file)
index 0000000..3066cf9
--- /dev/null
@@ -0,0 +1,10 @@
+using System;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyVersion ("1.0.0.0")]
+[assembly: AssemblyCulture ("en-US")]
+
+public class Lang
+{
+}
index 384866752c02cfd8a2b8a5aecd3dc33b5710ed39..2621ef6bc29d6b71925046336fdf0959b5c35d0c 100644 (file)
@@ -31,7 +31,7 @@ TEST_SUPPORT_FILES = \
        CS0619-43-lib.dll CS1546-lib.dll CS0619-51-lib.dll CS1509-module.dll CS1681-2-lib.dll \
        CS0730-lib.dll \
        CS1540-15-lib.dll CS1540-17-lib.dll CS1542-lib.dll CS1577-lib.dll \
-       CS1683-lib.dll CS1684-lib.dll CS1685-2-lib.dll \
+       CS1607-3-lib.dll CS1683-lib.dll CS1684-lib.dll CS1685-2-lib.dll \
        dlls/first/CS1701-lib.dll dlls/second/CS1701-lib.dll CS1701-lib.dll dlls/first/CS1702-lib.dll dlls/second/CS1702-lib.dll CS1702-lib.dll dlls/first/CS1705-lib.dll dlls/second/CS1705-lib.dll CS1705-lib.dll \
        CS2015-lib.dll CS3005-16-lib.dll CS3013-module.dll CSExternAlias-lib.dll \
        CSFriendAssembly-lib.dll \
diff --git a/mcs/errors/cs1607-3.cs b/mcs/errors/cs1607-3.cs
new file mode 100644 (file)
index 0000000..9268dfd
--- /dev/null
@@ -0,0 +1,13 @@
+// CS1607: Referenced assembly `CS1607-3-lib' has different culture setting of `en-US'
+// Line: 0
+// Compiler options: -r:CS1607-3-lib.dll -warnaserror
+
+using System;
+
+class Program
+{
+       static void Main ()
+       {
+               Console.WriteLine (typeof (Lang));
+       }
+}
index 704f5c1f9502db34ffeb0f54d9c7a3b7ae33c8f5..600e3039cb1fd6580a7ba826026a35e6981e5a00 100644 (file)
@@ -376,6 +376,12 @@ namespace Mono.CSharp
                                                a.FullName);
                                }
 
+                               var ci = a.Assembly.GetName ().CultureInfo;
+                               if (ci != System.Globalization.CultureInfo.InvariantCulture) {
+                                       Report.Warning (1607, 1, "Referenced assembly `{0}' has different culture setting of `{1}'",
+                                               a.Name, ci.Name);
+                               }
+
                                if (!a.IsFriendAssemblyTo (this))
                                        continue;