← Back to team overview

registry team mailing list archive

[Bug 392342] Re: Spurious unitialised variable error CS0165

 

Launchpad has imported 2 comments from the remote bug at
https://bugzilla.novell.com/show_bug.cgi?id=516676.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2009-06-25T23:39:26+00:00 directhex wrote:

Created an attachment (id=300508)
Test case

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.0.11)
Gecko/2009060309 Ubuntu/9.04 (jaunty) Firefox/3.0.11

A bug has been reported in Ubuntu which appears to be cause upstream -
see https://bugs.edge.launchpad.net/ubuntu/+source/mono/+bug/392342

The test case attached here, from that bug report, fails to build on
2.4.0 but built okay on 2.0.1

Reproducible: Always

Steps to Reproduce:
1.Build attached
Actual Results:  
test2.cs(33,81): error CS0165: Use of unassigned local variable `tags'


Expected Results:  
Compilation

Reply at: https://bugs.launchpad.net/mono/+bug/392342/comments/2

------------------------------------------------------------------------
On 2009-06-26T01:46:40+00:00 Chris Halse Rogers wrote:

For added strangeness that will possibly help you track this down I have
the following snippets of my attempts to work around this bug in the
GNOME Do plugins code:

This snippet builds:
Services.Application.RunOnThread ( () => {
	/* Mono 2.4 bug hack
	 * This can't use using () due to some crazy-wierd scoping problem.
	 * See https://bugzilla.novell.com/show_bug.cgi?id=516676 for details.
	 */
	IEnumerable<IFileItem> temp = uploads;
	UploadPool uploadQueue = new UploadPool (tags);
	try {
		foreach (IFileItem photo in uploads)
             		uploadQueue.EnqueueUpload (photo);
					uploadQueue.BeginUploads ();
	} finally {
		uploadQueue.Dispose ();
	}
});
This snippet: 
Services.Application.RunOnThread ( () => {
	/* Mono 2.4 bug hack
	 * This can't use using () due to some crazy-wierd scoping problem.
	 * See https://bugzilla.novell.com/show_bug.cgi?id=516676 for details.
	 */
	UploadPool uploadQueue = new UploadPool (tags);
	IEnumerable<IFileItem> temp = uploads;
	try {
		foreach (IFileItem photo in uploads)
			uploadQueue.EnqueueUpload (photo);
		
		uploadQueue.BeginUploads ();
	} finally {
		uploadQueue.Dispose ();
	}
});
fails, with "error CS0165: Use of unassigned local variable `uploads'"

Reply at: https://bugs.launchpad.net/mono/+bug/392342/comments/3

-- 
Spurious unitialised variable error CS0165
https://bugs.launchpad.net/bugs/392342
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for mono.