* typemanager.cs: Property.GetGetMethod() does not return the method if it
[mono.git] / mcs / mbas / expression.cs
index ca8746b7a973dd0196c6cb08b97f8618dc35d9e1..3a965aee11bb5fd8a6142c9d9a2e8d4526a8924f 100644 (file)
@@ -4525,8 +4525,8 @@ namespace Mono.MonoBASIC {
 
                        if (type.IsInterface || type.IsAbstract){
                                Error (
-                                       144, "It is not possible to create instances of interfaces " +
-                                       "or abstract classes");
+                                       30376, "It is not possible to create instances of Interfaces " +
+                                       "or classes marked as MustInherit");
                                return null;
                        }
                        
@@ -4742,7 +4742,7 @@ namespace Mono.MonoBASIC {
 
                void Error_IncorrectArrayInitializer ()
                {
-                       Error (178, "Incorrectly structured array initializer");
+                       Error (30567, "Incorrectly structured array initializer");
                }
                
                public bool CheckIndices (EmitContext ec, ArrayList probe, int idx, bool specified_dims)
@@ -5692,12 +5692,16 @@ namespace Mono.MonoBASIC {
                                                Enum en = TypeManager.LookupEnum (decl_type);
 
                                                Constant c;
-                                               if (en != null)
+                                               if (en != null) {
                                                        c = Constantify (o, en.UnderlyingType);
-                                               else 
+                                                       return new EnumConstant (c, en.UnderlyingType);
+                                               }
+                                               else {
                                                        c = Constantify (o, enum_member.Type);
+                                                       return new EnumConstant (c, enum_member.Type);
+                                               }
+                                               
                                                
-                                               return new EnumConstant (c, decl_type);
                                        }
                                        
                                        Expression exp = Constantify (o, t);
@@ -5770,10 +5774,10 @@ namespace Mono.MonoBASIC {
                                                if (IdenticalNameAndTypeName (ec, left_original, loc))
                                                        return member_lookup;
 
-                                               if (left_is_explicit) {
+                                               /*if (left_is_explicit) {
                                                        error176 (loc, me.Name);
                                                        return null;
-                                               }
+                                               }*/
                                        }
 
                                        //
@@ -5852,15 +5856,14 @@ namespace Mono.MonoBASIC {
                        
                        Type expr_type = expr.Type;
                        if ((expr is TypeExpr) && (expr_type.IsSubclassOf (TypeManager.enum_type))){
-                               
                                Enum en = TypeManager.LookupEnum (expr_type);
                                
                                if (en != null) {
                                        object value = en.LookupEnumValue (ec, Identifier, loc);
-
+                                       expr_type = TypeManager.int32_type;
                                        if (value != null){
                                                Constant c = Constantify (value, en.UnderlyingType);
-                                               return new EnumConstant (c, expr_type);
+                                               return new EnumConstant (c, en.UnderlyingType);
                                        }
                                }
                        }
@@ -5888,7 +5891,7 @@ namespace Mono.MonoBASIC {
                                        BindingFlags.NonPublic, Identifier);
                                        
                                if (lookup == null)
-                                       Error (117, "'" + expr_type + "' does not contain a definition for '" + Identifier + "'");
+                                       Error (30456, "'" + expr_type + "' does not contain a definition for '" + Identifier + "'");
                                else
                                {
                                        if ((expr_type != ec.ContainerType) &&
@@ -5912,10 +5915,10 @@ namespace Mono.MonoBASIC {
                                                       "qualifier must be of type '" + TypeManager.MonoBASIC_Name (ec.ContainerType) + "' " +
                                                       "(or derived from it)");
                                                else
-                                                       Error (122, "'" + expr_type + "." + Identifier + "' " +
+                                                       Error (30390, "'" + expr_type + "." + Identifier + "' " +
                                                       "is inaccessible because of its protection level");
                                        } else
-                                               Error (122, "'" + expr_type + "." + Identifier + "' " +
+                                               Error (30390, "'" + expr_type + "." + Identifier + "' " +
                                               "is inaccessible because of its protection level");
                                }  
                                return null;
@@ -6762,7 +6765,7 @@ namespace Mono.MonoBASIC {
                                                      AllMemberTypes, AllBindingFlags, loc);
 
                        if (member_lookup == null) {
-                               Error (117,
+                               Error (30456,
                                              TypeManager.MonoBASIC_Name (base_type) + " does not " +
                                              "contain a definition for '" + member + "'");
                                return null;