Hi Marek,

Maybe I should have been more complete. All uses of the KindNormal
constant in the DayDiary.cs file where it is defined cause the same
error although it is a local constant!

I know this is weird, but it gets worse: all DayDiary.cs 'error' line
nrs reporting [`ZzLib.DayDiary' does not contain a definition for
`KindNormal'] are wrong. The offset starts at 14 (actual line 1681, but
1667 reported), continues with 23 (1713 vs 1690) and then stabilises on
24 (1806-1782, 1869-1845, 1877-1853...)

All uses of DayDiary.KindNormal in any source complain with the above
error. Line nrs are correct for these sources.

Anyway, I replaced all local 'KindNormal' with '0 /*KindNormal*/' and all
'DayDiary.KindNormal' by '0 /*DayDiary.KindNormal*/', and the project
compiles on MonoDevelop and the command line and runs fine in the
simulator.

So I'm no longer stuck, but this is truly a weird error.

Thanks for the workaround :)

With kind regards,


Guido.


On 21 February 2013 18:00, Marek Safar <[email protected]> wrote:
> Hi,
>
>>
>> The constructor is very straightforward (and it hasn't changed in weeks)
>>
>>         public BarButtonView(Txt.Id id, int kind =  DayDiary.KindNormal)
>>             : base(new RectangleF(0f, 0f, Width, Height))
>
>
> It looks straightforward but it isn't. I remember fixing such thing and this
> should not happen in future releases for now as I workaround try to replace
> int kind =  DayDiary.KindNormal with int kind = 0 or make the KindNormal
> constant local to this class.
>
> Marek
>
>
>>
>>         {
>>             _kind = kind;
>>             _id = id;
>>             BackgroundColor = UIColor.Clear;
>>             var font = UIFont.BoldSystemFontOfSize(24);
>>             var text = Txt.Get(id);
>>             var frame = new RectangleF(0, 0, Width, Height);
>>             AddSubview(MCiOS.ShadowLabel
>>                 (frame, text, font, UITextAlignment.Center,
>> Color.Fg.Window));
>>         }
>>
>> It complains that KindNormal is undefined. It's been defined about a
>> year ago :)
>>
>> /Users/guivho/Mono/Targister/Targister/Classes/BarButtonView.cs(13,62):
>> error CS0117: `ZzLib.DayDiary' does not contain a definition for
>> `KindNormal'
>> /Users/guivho/Mono/Targister/Targister/Tables/DayDiary.cs(9,18):
>> (Location of the symbol related to previous error)
>> /Users/guivho/Mono/Targister/Targister/Classes/BarButtonView.cs(13,62):
>> error CS0584: Internal compiler error:
>> /Users/guivho/Mono/Targister/Targister/Classes/BarButtonView.cs(13,62):
>> Mono.CSharp.DefaultParameterValueExpression ExprClass is Invalid after
>> resolve
>> /Users/guivho/Mono/Targister/Targister/Classes/BarButtonView.cs(13,62):
>> error CS1736: The expression being assigned to optional parameter `kind'
>> must be a constant or default value
>>
>> Ad here's the start of DayDiary.cs:
>>     public class DayDiary
>>     {
>>         #region Inc enum
>>
>>         public enum Inc
>>         {
>>             Day,
>>             Week,
>>             Month,
>>             Year
>>         };
>>
>>         #endregion
>>
>>         public const int KindNormal = 0;
>>         public const int KindTarget = 1;
>>
>>
>> Marek, if needed I'm willing to mail you personally the full project,
>> just give me a shout.
>>
>> Guido
>>
>>
>>
>>
>> On 21 February 2013 11:19, Marek Safar <[email protected]> wrote:
>> > Hi Guido,
>> >
>> > Could you paste exact code signature of your constructor
>> >
>> > ZzLib.BarButtonView.BarButtonView(ZzLib.Txt.Id, int)
>> >
>> > Thanks
>> > Marek
>> >
>> >
>> > On Thu, Feb 21, 2013 at 11:11 AM, Guido Van Hoecke <[email protected]>
>> > wrote:
>> >>
>> >> Hi,
>> >>
>> >> My app compiles fine in Visual Studio, but throws an
>> >> InternalErrorException in MonoDevelop as well as when building from the
>> >> command line.
>> >>
>> >> I'm stuck.
>> >>
>> >> I even restarted my Mac, hoping the problem would go away, as it often
>> >> did in the MS world, but it did not.
>> >>
>> >> I can still continue development in the VirtualBox MS environment, but
>> >> obviously, I can't do any testing, only provide compiling sources.
>> >> Alas,
>> >> they now compile in MS, not in MD!
>> >>
>> >> Any ideas, any one?
>> >>
>> >>
>> >> Unhandled Exception:
>> >> 0   mono                                0x000dfe1b mono + 912923
>> >> 1   mono                                0x000e0285 mono + 914053
>> >> 2   mono                                0x000e1085 mono + 917637
>> >> 3   mono                                0x000e1f51 mono + 921425
>> >> 4   mono                                0x0015169d mono + 1377949
>> >> 5   ???                                 0x00500f8f 0x0 + 5246863
>> >> at Mono.CSharp.TypeContainer.EmitType () <0x0013c>
>> >> at Mono.CSharp.ModuleContainer.Emit () <0x001c0>
>> >> at Mono.CSharp.AssemblyDefinition.Emit () <0x00124>
>> >> at Mono.CSharp.Driver.Compile () <0x00434>
>> >> at Mono.CSharp.Driver.Main (string[]) <0x000b0>
>> >> at (wrapper runtime-invoke) <Module>.runtime_invoke_int_object
>> >> (object,intptr,intptr,intptr) <0x00096>
>> >> 12  mono                                0x00010caf mono + 64687
>> >> 13  mono                                0x0022694a mono + 2251082
>> >> 14  mono                                0x002294ec mono + 2262252
>> >> 15  mono                                0x00228751 mono + 2258769
>> >> 16  mono                                0x000acfff mono + 704511
>> >> 17  mono                                0x000ad250 mono + 705104
>> >> 18  mono                                0x000af6bf mono + 714431
>> >> 19  mono                                0x00002134 mono + 4404
>> >> 20  mono                                0x000021c8 mono + 4552
>> >> 21  mono                                0x00001ee5 mono + 3813
>> >>
>> >> [ERROR] FATAL UNHANDLED EXCEPTION: Mono.CSharp.InternalErrorException:
>> >> /Users/guivho/Mono/Targister/Targister/Classes/BarButtonView.cs(13,16):
>> >> ZzLib.BarButtonView.BarButtonView(ZzLib.Txt.Id, int) --->
>> >> System.NullReferenceException: Object reference not set to an instance
>> >> of an object
>> >>   at Mono.CSharp.Parameter.ApplyAttributes
>> >> (System.Reflection.Emit.MethodBuilder mb,
>> >> System.Reflection.Emit.ConstructorBuilder cb, Int32 index,
>> >> Mono.CSharp.PredefinedAttributes pa) [0x00000] in <filename unknown>:0
>> >>   at Mono.CSharp.ParametersCompiled.ApplyAttributes (IMemberContext
>> >> mc, System.Reflection.MethodBase builder) [0x00000] in <filename
>> >> unknown>:0
>> >>   at Mono.CSharp.Constructor.Emit () [0x00000] in <filename unknown>:0
>> >>   at Mono.CSharp.TypeContainer.EmitConstructors () [0x00000] in
>> >> <filename unknown>:0
>> >>   --- End of inner exception stack trace ---
>> >>   at Mono.CSharp.TypeContainer.EmitConstructors () [0x00000] in
>> >> <filename unknown>:0
>> >>   at Mono.CSharp.TypeContainer.EmitType () [0x00000] in <filename
>> >> unknown>:0
>> >>   at Mono.CSharp.ModuleContainer.Emit () [0x00000] in <filename
>> >> unknown>:0
>> >>   at Mono.CSharp.AssemblyDefinition.Emit () [0x00000] in <filename
>> >> unknown>:0
>> >>   at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0
>> >>   at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in
>> >> <filename unknown>:0
>> >>
>> >>
>> >>
>> >> Guido
>> >>
>> >> --
>> >> Someday we'll look back on this moment and plow into a parked car.
>> >>                 -- Evan Davis
>> >>
>> >> http://vanhoecke.org ... and go2 places!
>> >> _______________________________________________
>> >> MonoTouch mailing list
>> >> [email protected]
>> >> http://lists.ximian.com/mailman/listinfo/monotouch
>> >
>> >
>
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to