fbpx

X# differes from C# ? - IEnumerable ?? Help ???

More
1 year 11 months ago #1 by Phil Hepburn
Hi Robert and Team, and anyone else with knowledge,

I have a small (but interesting?) problem, while converting work C# app code to X#. So far everything has translated as I thought it should / would. Until now when I come to 'IEnumerable'.

Both C# and X# apps are targeted at the .NET 4.5.2 but the C# code allows me to use a 'Type' free form of IEnumerable, whereas the X# code gives me an error unless I use the Typed form.

I include image detail so you can see what I meant. Can you explain to me WHY ? anybody ?

Also, there is the image with the X# interesting way out for me - the use of 'local implied' - works a treat. Can anyone explain PLEASE ?!













I hope you understand my problem from the image detail supplied.
TIA,
and Regards,
Phil.
Wales, UK.

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #2 by Chris Pyrgas
Replied by Chris Pyrgas on topic X# differes from C# ? - IEnumerable ?? Help ???
Hi Phil,

My guess is that you are using in your code a USING System.Collections.Generic and not a USING System.Collections, so the compiler tries to use the generic version of IEnumerable. But without seeing the complete prg file, this is only a guess.

Chris

XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

More
1 year 11 months ago #3 by Phil Hepburn
Replied by Phil Hepburn on topic X# differes from C# ? - IEnumerable ?? Help ???
Hi Chris,

You are 'spot on' !

What a clever man you are ;-0)

This is the result of chopping up code, cut and paste, drag and copy, and all that sort of thing to make life easier. From one open instance of VS to another.

Still, we live and learn - I try to learn at least one new thing each day - this is a good start !!!

And 'local implied' did get me out of a hole when I did not know what else to do ;-0)

Now then ... upwards and onwards >>>
Cheers,
Phil.
Wales, UK.

Please Log in or Create an account to join the conversation.