Forums

crazy?

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

crazy?

Postby kobi7 » Wed Jan 29, 2014 9:53 am

please note line 152
the arrow marks the current line in the debugger.

the locals pane shows something a little crazy.

hassubs, nosubs are both false.
kind of amusing, and maybe rare so I'm sharing with you.

What do you make of it? :-)
(and what should my next step be? :roll: )

kobi
Attachments
crazy.png
crazy.png (90.3 KiB) Viewed 3404 times
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
kobi7
 
Posts: 82
Location: Israel

Re: crazy?

Postby nerdzero » Wed Jan 29, 2014 11:29 am

Could be a bug in the Mono debugger. What does "trace nosubs" show as the value?
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: crazy?

Postby kobi7 » Wed Jan 29, 2014 9:49 pm

it states:

trace: hassubs=false
- nosubs=false
- at GardenController.cobra:153
- in GardenController<of>.vc_check
- subclass GardenController`1


When I compiled monodevelop, I compiled mono from a git source, though I assume that such a fundamental logic error would show itself previously.
I guess I have to accept that reality is not logical ;-) hehe this episode is kind of strange to me.
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
kobi7
 
Posts: 82
Location: Israel

Re: crazy?

Postby nerdzero » Thu Jan 30, 2014 9:08 am

:o
nerdzero
 
Posts: 286
Location: Chicago, IL

Re: crazy?

Postby kobi7 » Thu Jan 30, 2014 9:24 am

how shall we ever get to the bottom of it? :-)
care to test the code? I can send you the source if you promise not to peek. hehe just kidding

joined debug session?
leave your email address, or send an email to me: kobi2187@gmail.com
I can zip it all, and put somewhere.
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
kobi7
 
Posts: 82
Location: Israel

a short update

Postby kobi7 » Sat Feb 01, 2014 12:41 am

nerdzero dexterously found the problem, and a bug report was filed #359

it had to do with nilable values that were not nil, regarded as true, no matter what the value inside actually is (which in this case was 'false')
came about when using dynamic? (or Object? I'm not sure) from an external library. (I just forgot to state the result type of a boolean getter)

any truth value that if accepts is probably susceptible here.
Falun Dafa is Good.
Truth, Compassion, Forbearance is Good.
kobi7
 
Posts: 82
Location: Israel

Re: crazy?

Postby hopscc » Sat Feb 01, 2014 5:08 am

It comes down to assuming the action on a short cut notation conditional test ( for a nilable Object or nilable Dynamic type from a library)
and/or not explicitly typing your getters .
( not helped by the doc/wiki being silent on that exact case).
If either the test was explicitly expanded, the item correctly cast or the getter was explicitly typed you would have been fine

any truth value that if accepts is probably susceptible here.

If its declared (explicitly or implicitly ) as nilable (Object/Dynamic) and not cast to the underlying type for an implicit truth test.


You can often see some light from problems such as these by looking at the generated C# code ( -kif option to compiler keeps the intermediate files around after compilation x.cobra -> x.cobra.cs) .

Alternatively and perhaps easier the ct_trace statement tells the compiler to emit some info about a variable as it goes through the various compiler stages, working out what it is, what interim type, final type, etc..
ct_trace hassubs

The output may be a little unintelligible to understand at first pass. (ctTrace)
hopscc
 
Posts: 631
Location: New Plymouth, Taranaki, New Zealand


Return to Discussion

Who is online

Users browsing this forum: No registered users and 6 guests

cron