Bug 2656 - CS0016 compilation problem
Summary: CS0016 compilation problem
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2011-12-27 19:04 UTC by manvsteeth
Modified: 2012-01-06 06:19 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description manvsteeth 2011-12-27 19:04:19 UTC
Cross posted from stackoverflow & mono forums:

Here's the error I'm getting: 

Error CS0016: Could not write to file Fact.Apprentice.Core', cause: Type '<>__AnonType02' was not completed. (CS0016) (Fact.Apprentice.Core - Mono) 

If I compile using MonoDevelop + Microsoft .NET, no such error shows up. When using Mono framework, I am unable to compile because of this. Behavior identical for Mac or PC installation. 

Also, unlike other errors of a similar ilk - it doesn't direct me to an offending file - so I don't know where amongst my dozens of source code files to begin searching for the error
Comment 1 Marek Safar 2011-12-29 04:11:18 UTC
Can you provide steps how to reproduce the issue
Comment 2 manvsteeth 2011-12-29 04:16:29 UTC
Yes and no.  I can reproduce it 100% of the time by compiling our proprietary library.  But sharing that library with others would be tricky it being company property and all that.  I will dig into sharing it with you, but in the meantime is there something else we can try?
Comment 3 Marek Safar 2011-12-29 04:19:53 UTC
you can try to compile it with mono master which could have the bug fixed already.
Comment 4 manvsteeth 2011-12-29 04:25:56 UTC
I'm not sure what that is, 'mono master'.  How do I try it?
Comment 5 Marek Safar 2011-12-29 04:30:46 UTC
In that case it will be easier for you to try to isolate the problem. The error is coming from C# anonymous type which probably has some special properties.
Comment 6 manvsteeth 2011-12-29 04:40:35 UTC
What's peculiar is (luckily) there is only one instance that I can find of an anonymous type yet commenting that portion out does not clear up the error.

Also the error suggests I have made a partial anonymous class, which to my knowledge is not possible within the language confines of C#
Comment 7 manvsteeth 2012-01-05 13:34:20 UTC
Any word?
Comment 8 Marek Safar 2012-01-05 18:19:21 UTC
Looking at the generated name, AnonType02 there are most likely more than 1 anonymous types created but I didn't see the code, so it's hard to be certain. You could send me the code or at least some part of it to my private email if you wish.
Comment 9 Marek Safar 2012-01-06 06:19:44 UTC
Fixed in master.