[Mono-devel-list] Bug with control-flow-analysis

Hervé Poussineau poussine at freesurf.fr
Tue Jul 29 16:35:02 EDT 2003


Hello everybody,

I have a bug when compiling following code:
class TestClass
{
 public static void Main()
 {
  int a;
  method(out a);
 }

 public static bool method(out int a)
 {
  try
  {
   a = 0;
   return true;
  }
  catch (System.Exception)
  {
   a = -1;
   return false;
  }
 }
}

mcs reports:
>mcs bug.cs
bug.cs(21) error CS0177: The out parameter `a' must be assigned before
control leave the current method.
Compilation failed: 1 error(s), 0 warnings

whereas csc works fine.

Additional informations:
* I am using today snapshot of mcs (monolite-20030729.tar.gz)
* I am running Windows with .NET 1.1

Hervé




More information about the Mono-devel-list mailing list