* test-nonsealed-valueclass.il: New. Value class should be sealed.
In ilasm/codegen:
* ExternTable.cs (ExternTable.GetTypeRef): Emit a warning if mscorlib is
referenced without a corresponding '.assembly extern' directive.
* TypeDef.cs (TypeDef.Define): Valuetype class should be sealed. Emit
warning if its not, and make it so.
In class/PEAPI:
* Metadata.cs (TypeAttr): Add [Flags] attribute.
svn path=/trunk/mcs/; revision=57150
+2006-02-22 Ankit Jain <jankit@novell.com>
+
+ * Metadata.cs (TypeAttr): Add [Flags] attribute.
+
2006-02-20 Ankit Jain <jankit@novell.com>
* PEAPI.cs (PEFileException): Update error message.
/// <summary>
/// Attibutes for a class
/// </summary>
+ [Flags]
public enum TypeAttr {Private, Public, NestedPublic, NestedPrivate,
NestedFamily, NestedAssembly, NestedFamAndAssem, NestedFamOrAssem,
SequentialLayout, ExplicitLayout = 0x10, Interface = 0x20,
+2006-02-22 Ankit Jain <jankit@novell.com>
+
+ * ExternTable.cs (ExternTable.GetTypeRef): Emit a warning if mscorlib is
+ referenced without a corresponding '.assembly extern' directive.
+ * TypeDef.cs (TypeDef.Define): Valuetype class should be sealed. Emit
+ warning if its not, and make it so.
+
2006-02-20 Ankit Jain <jankit@novell.com>
* *.cs: Update all .cs files to use Report.Error instead of directly
public ExternTypeRef GetTypeRef (string asmb_name, string full_name, bool is_valuetype)
{
ExternAssembly ext_asmb = null;
- if (assembly_table == null && (asmb_name == "mscorlib" || asmb_name == "corlib"))
+ if (assembly_table == null && (asmb_name == "mscorlib" || asmb_name == "corlib")) {
/* AddCorlib if mscorlib is being referenced but
we haven't encountered a ".assembly 'name'" as yet. */
+ Console.Error.WriteLine ("Warning -- Reference to undeclared extern assembly '{0}', adding.", asmb_name);
AddCorlib ();
+ }
if (assembly_table != null)
ext_asmb = assembly_table[asmb_name] as ExternAssembly;
is_enum_class = true;
}
+ if (is_value_class && (attr & PEAPI.TypeAttr.Sealed) == 0) {
+ Console.WriteLine ("Warning -- Non-sealed value class, made sealed.");
+ attr |= PEAPI.TypeAttr.Sealed;
+ }
+
if (outer != null) {
if (!outer.IsDefined)
outer.Define (code_gen);
+2006-02-22 Ankit Jain <jankit@novell.com>
+
+ * test-nonsealed-valueclass.il: New. Value class should be sealed.
+
2006-02-20 Ankit Jain <jankit@novell.com>
* generics-al.i, test-29.il: Remove. These use invalid style of
--- /dev/null
+// Test for a non-sealed value class
+// ilasm gives a warning and seals the class
+
+.class public test
+ extends [mscorlib]System.ValueType
+{
+}