projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2003-04-19 Miguel de Icaza <miguel@ximian.com>
[mono.git]
/
mcs
/
mcs
/
ecore.cs
diff --git
a/mcs/mcs/ecore.cs
b/mcs/mcs/ecore.cs
index ee129c5c702208b7089309425330b76fc7417e78..46a3c677a1a5e01ad9ecd576180fd6d508ca82b8 100755
(executable)
--- a/
mcs/mcs/ecore.cs
+++ b/
mcs/mcs/ecore.cs
@@
-336,7
+336,7
@@
namespace Mono.CSharp {
if ((e is TypeExpr) || (e is ComposedCast)) {
if ((flags & ResolveFlags.Type) == 0) {
if ((e is TypeExpr) || (e is ComposedCast)) {
if ((flags & ResolveFlags.Type) == 0) {
- e.Error
118
(flags);
+ e.Error
_UnexpectedKind
(flags);
return null;
}
return null;
}
@@
-346,7
+346,7
@@
namespace Mono.CSharp {
switch (e.eclass) {
case ExprClass.Type:
if ((flags & ResolveFlags.VariableOrValue) == 0) {
switch (e.eclass) {
case ExprClass.Type:
if ((flags & ResolveFlags.VariableOrValue) == 0) {
- e.Error
118
(flags);
+ e.Error
_UnexpectedKind
(flags);
return null;
}
break;
return null;
}
break;
@@
-369,7
+369,7
@@
namespace Mono.CSharp {
FieldInfo fi = ((FieldExpr) e).FieldInfo;
Console.WriteLine ("{0} and {1}", fi.DeclaringType, fi.Name);
FieldInfo fi = ((FieldExpr) e).FieldInfo;
Console.WriteLine ("{0} and {1}", fi.DeclaringType, fi.Name);
- e.Error
118
(flags);
+ e.Error
_UnexpectedKind
(flags);
return null;
}
break;
return null;
}
break;
@@
-729,7
+729,7
@@
namespace Mono.CSharp {
// notice that it is possible to write "ValueType v = 1", the ValueType here
// is an abstract class, and not really a value type, so we apply the same rules.
//
// notice that it is possible to write "ValueType v = 1", the ValueType here
// is an abstract class, and not really a value type, so we apply the same rules.
//
- if (target_type == TypeManager.object_type
|| target_type == TypeManager.value_type
) {
+ if (target_type == TypeManager.object_type) {
//
// A pointer type cannot be converted to object
//
//
// A pointer type cannot be converted to object
//
@@
-740,6
+740,11
@@
namespace Mono.CSharp {
return new BoxedCast (expr);
if (expr_type.IsClass || expr_type.IsInterface || expr_type == TypeManager.enum_type)
return new EmptyCast (expr, target_type);
return new BoxedCast (expr);
if (expr_type.IsClass || expr_type.IsInterface || expr_type == TypeManager.enum_type)
return new EmptyCast (expr, target_type);
+ } else if (target_type == TypeManager.value_type) {
+ if (expr_type.IsValueType)
+ return new BoxedCast (expr);
+ if (expr is NullLiteral)
+ return new BoxedCast (expr);
} else if (expr_type.IsSubclassOf (target_type)) {
//
// Special case: enumeration to System.Enum.
} else if (expr_type.IsSubclassOf (target_type)) {
//
// Special case: enumeration to System.Enum.
@@
-2467,7
+2472,7
@@
namespace Mono.CSharp {
/// <summary>
/// Reports that we were expecting `expr' to be of class `expected'
/// </summary>
/// <summary>
/// Reports that we were expecting `expr' to be of class `expected'
/// </summary>
- public void Error
118
(string expected)
+ public void Error
_UnexpectedKind
(string expected)
{
string kind = "Unknown";
{
string kind = "Unknown";
@@
-2477,7
+2482,7
@@
namespace Mono.CSharp {
"' where a `" + expected + "' was expected");
}
"' where a `" + expected + "' was expected");
}
- public void Error
118
(ResolveFlags flags)
+ public void Error
_UnexpectedKind
(ResolveFlags flags)
{
ArrayList valid = new ArrayList (10);
{
ArrayList valid = new ArrayList (10);