From 6a2255bf98f055084c7cc7560635d8040e06f8c5 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sat, 29 Jun 2002 03:21:05 +0000 Subject: [PATCH] 2002-06-29 Martin Baulig * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr is the NullLiteral, we also need to make sure that target_type is not an enum type. svn path=/trunk/mcs/; revision=5497 --- mcs/mcs/ChangeLog | 6 ++++++ mcs/mcs/ecore.cs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 91b3b3bd43d..3be6e33ca25 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,3 +1,9 @@ +2002-06-29 Martin Baulig + + * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr + is the NullLiteral, we also need to make sure that target_type is not + an enum type. + 2002-06-29 Martin Baulig * rootcontext.cs (RootContext.ResolveCore): We must initialize diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index 991cf70dccf..51c6dc77642 100755 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -812,7 +812,8 @@ namespace Mono.CSharp { return true; // from the null type to any reference-type. - if (expr is NullLiteral && !target_type.IsValueType) + if (expr is NullLiteral && !target_type.IsValueType && + !TypeManager.IsEnumType (target_type)) return true; } -- 2.25.1