diff options
author | Martin Baulig <martin@novell.com> | 2004-06-18 04:51:27 +0400 |
---|---|---|
committer | Martin Baulig <martin@novell.com> | 2004-06-18 04:51:27 +0400 |
commit | 043e069ece3e158859bd05ebe69f8243c3839d33 (patch) | |
tree | eef0ceb9335fd4c75a54fe19c27328dbc1410cd2 /mcs | |
parent | 57a33056a115c6b23e23a06e5fdfeb6f7532eae5 (diff) |
2004-06-18 Martin Baulig <martin@ximian.com>
* attribute.cs (Attribute.Resolve): Check whether we're an
EmptyCast which a Constant child. Fixes #60333.
svn path=/trunk/mcs/; revision=29821
Diffstat (limited to 'mcs')
-rwxr-xr-x | mcs/mcs/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/mcs/attribute.cs | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 0129e53816e..d15bf27abd1 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,8 @@ +2004-06-18 Martin Baulig <martin@ximian.com> + + * attribute.cs (Attribute.Resolve): Check whether we're an + EmptyCast which a Constant child. Fixes #60333. + 2004-06-17 Ben Maurer <bmaurer@ximian.com> * statement.cs (EmitCollectionForeach): Account for the fact that diff --git a/mcs/mcs/attribute.cs b/mcs/mcs/attribute.cs index 9d4fa9e5b29..05a3f26f153 100644 --- a/mcs/mcs/attribute.cs +++ b/mcs/mcs/attribute.cs @@ -387,9 +387,14 @@ namespace Mono.CSharp { return null; } + Type type = e.Type; + EmptyCast ecast = e as EmptyCast; + if ((ecast != null) && (ecast.Child is Constant)) + e = ecast.Child; + Constant c = e as Constant; if (c != null) { - if (c.Type != pi.PropertyType) { + if (type != pi.PropertyType) { c = Const.ChangeType (Location, c, pi.PropertyType); if (c == null) return null; @@ -425,12 +430,17 @@ namespace Mono.CSharp { return null; } + Type type = e.Type; + EmptyCast ecast = e as EmptyCast; + if ((ecast != null) && (ecast.Child is Constant)) + e = ecast.Child; + // // Handle charset here, and set the TypeAttributes Constant c = e as Constant; if (c != null) { - if (c.Type != fi.FieldType) { + if (type != fi.FieldType) { c = Const.ChangeType (Location, c, fi.FieldType); if (c == null) return null; |