if(<var> is <type>) not compiled properly when <type> is a delegate. #84

Closed
vgribok opened this Issue Jul 12, 2011 · 2 comments

Comments

Projects
None yet
2 participants
@vgribok

vgribok commented Jul 12, 2011

Hi!

I have this in C#:

namespace somens
{
internal delegate object CalcValueDelegate(object entity);
...
void somemethod(objet val)
{
if(val is CalcValueDelegate)
...

The last line gets compiled to JS as "if (Type.canCast(val, somens._calcValueDelegate))", and _calcValueDelegate is not defined in the JS output file produced by S# compiler, leading to a runtime error.

Vlad.

@nikhilk

This comment has been minimized.

Show comment Hide comment
@nikhilk

nikhilk Aug 7, 2011

Owner

Will fix this to generate:

if (Type.canCast(val, Function))

A delegate is basically a function under the covers.

Owner

nikhilk commented Aug 7, 2011

Will fix this to generate:

if (Type.canCast(val, Function))

A delegate is basically a function under the covers.

@nikhilk

This comment has been minimized.

Show comment Hide comment
@nikhilk

nikhilk Aug 14, 2011

Owner

The above change should be included in the 0.7.3 release.

Owner

nikhilk commented Aug 14, 2011

The above change should be included in the 0.7.3 release.

@nikhilk nikhilk closed this Aug 14, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment