From 575b7f5202ffc38c2ee9b8b8ec007d5eab249150 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Tue, 5 Mar 2002 21:36:41 +0000 Subject: [PATCH] 2002-03-05 Miguel de Icaza * expression.cs (Is.DoResolve): If either side of the `is' is an interface, do not flag the warning. * ecore.cs (ImplicitReferenceConversion): We need a separate test for interfaces svn path=/trunk/mcs/; revision=2930 --- mcs/mcs/ChangeLog | 8 ++++++++ mcs/mcs/ecore.cs | 2 +- mcs/mcs/expression.cs | 2 +- mcs/mcs/report.cs | 5 ++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/mcs/mcs/ChangeLog b/mcs/mcs/ChangeLog index 126412b2fee..671ebc33b1e 100755 --- a/mcs/mcs/ChangeLog +++ b/mcs/mcs/ChangeLog @@ -1,5 +1,13 @@ 2002-03-05 Miguel de Icaza + * expression.cs (Is.DoResolve): If either side of the `is' is an + interface, do not flag the warning. + + * ecore.cs (ImplicitReferenceConversion): We need a separate test + for interfaces + + * report.cs: Allow for --fatal to be used with --probe. + * typemanager.cs (NoTypes): Move the definition for the empty Type array here. diff --git a/mcs/mcs/ecore.cs b/mcs/mcs/ecore.cs index 523573368f7..c1194bcf1b2 100755 --- a/mcs/mcs/ecore.cs +++ b/mcs/mcs/ecore.cs @@ -559,7 +559,7 @@ namespace Mono.CSharp { if (expr_type.IsValueType) return new BoxedCast (expr); - if (expr_type.IsClass) + if (expr_type.IsClass || expr_type.IsInterface) return new EmptyCast (expr, target_type); } else if (expr_type.IsSubclassOf (target_type)) { return new EmptyCast (expr, target_type); diff --git a/mcs/mcs/expression.cs b/mcs/mcs/expression.cs index bcb07955575..35f515a73e0 100755 --- a/mcs/mcs/expression.cs +++ b/mcs/mcs/expression.cs @@ -891,7 +891,7 @@ namespace Mono.CSharp { } if (expr.Type != probe_type && !probe_type.IsSubclassOf (expr.Type)){ - if (!probe_type.IsInterface) + if (!(probe_type.IsInterface || expr.Type.IsInterface)) Report.Warning ( 184, loc, "The expression is never of type `" + diff --git a/mcs/mcs/report.cs b/mcs/mcs/report.cs index 574ec6588b7..524b9491725 100644 --- a/mcs/mcs/report.cs +++ b/mcs/mcs/report.cs @@ -59,7 +59,10 @@ namespace Mono.CSharp { static void Check (int code) { - if (code == probe_error){ + if (code == probe_error){ + if (Fatal) + throw new Exception (); + Environment.Exit (123); } } -- 2.25.1