I don't know whether to call this a bug, but this code can result in an
access of the List list, without assigning to it (in the case b is false):
public static void Foo(bool b)
{
int i;
List<int> list;
if (b && !dict.TryGetValue("foo", out list)) {
dict["foo"] = new List<int>();
} else {
i = list[0];
}
}
Visual studio flags this as a compiler error. I am using:
$ mono --version
Mono JIT compiler version 2.11 ((no/7917753 Wed Mar 30 15:47:09 EDT 2011)
Copyright (C) 2002-2011 Novell, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
LLVM: yes(2.8svn-mono)
GC: Included Boehm (with typed GC and Parallel Mark)
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list