Open GoogleCodeExporter opened 8 years ago
Have you tried setting:
[assembly: JsType(TargetType=typeof(int), OmitCasts=false, NativeCasts=false)]
Basically, if OmitCasts is true, any casting will be removed, and if any code
is asking "x is Type", it will be converted to "true"
Original comment by DanelK...@gmail.com
on 5 Feb 2014 at 9:08
In this instance I need the type check. It's used in a heterogeneous storage of
either an integer or a map of integers. The int check is actually doing what
you say - the type check is being converted into "true". I only see this for
checks against int so far.
I've worked around the issue using a more verbose form:
o.GetType() == typeof(int)
Original comment by co...@gravill.com
on 10 Feb 2014 at 2:35
Yes, casts are omitted by default in SharpKit.JavaScript.dll:
[assembly: JsType(TargetType = typeof(int), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(object), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(byte), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(short), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(double), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(float), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(uint), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(ushort), OmitCasts = true)]
[assembly: JsType(TargetType = typeof(decimal), OmitCasts = true)]
Would you like to try removing those, and extend $Cast() and $Is() to work with
them as expected? It would give you a lot of flexibility.
Original comment by DanelK...@gmail.com
on 11 Feb 2014 at 9:41
Original issue reported on code.google.com by
co...@gravill.com
on 28 Jan 2014 at 5:51