[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Pnet trivia : how to typecast?

From: Gopal V
Subject: Re: [DotGNU]Pnet trivia : how to typecast?
Date: Fri, 24 Jan 2003 12:12:40 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, James Michael DuPont wrote:
> here are some of the interesting functions
> GetIndirectConvertRules -- 

Actually GetIndirectConvertRules is a 2 step conversion for types ...
A -> B -> C for A->C conversion ....

For example "inch" and "centimeter" types can be converted into "meter"
and back .. So "inch" to "centimeter" might go via the "meter" ...

inch -> meter -> centimeter 

A curious feature ... which I have implemented crudely ... (which is to
say, it picks the first valid conversion instead of the best :)

> ILCanCoerceNodeKind     -- 

This allows you to typecast considering the value of the node itself...
For example , -1 to uint is not possible while 1 to uint is possible..

> type=0x21  : that means it uses less space in memory?

yes... Primitive type

> bye the way, I solved a bug report. 
> the error message was not good enough.

Not really ... The int -> uint is an implicit conversion for literal "1" ..
ILResolveMethod only checks for ILCanCoerceKind and not ILCanCoerceNodeKind.

I'm not really sure how to fix it ... because passing nodes into 
ILResolveMethod would mean I'd have to hack about all around cscc ...
Not something I would want to do right now due to lack of time in

This is more of a bug with a workaround .... explicitly typecast 1 as 
a uint :)

The difference between insanity and genius is measured by success

reply via email to

[Prev in Thread] Current Thread [Next in Thread]