Problem with Swift Dictionary in C# / .NET

you can see the build log clicking the “build successful” text, or via the Messages menu. it’s that build log i need. ideally a rebuild.

build logs from Fire.txt (9.0 KB)

And did you manage to run the project I sent you?

Reference: /Applications/Fire.app/Contents/Resources/References/Echoes/Swift.dll'

here’s your problem. you’re still using the old Swift.dll in Fire, not the new one Carlo sent you.

what’s your account name on our website? might be easiest if i just give you access to the latest gamma version of Fire, which also has the fixed Swift.dll.

I thought all I had to do was switch the Swift.dll when adding to the C# project.
My email is rodrigo.ruiz7@gmail.com and my account is rodrigoruiz.

I tried manually switching the Swift.dll inside Fire.app on the path you said, but I’m getting compilation errors now like “type mismatch”.

@mh ?

That won’t work, because the dll you built is explicitly linked against the older version of the Swift.dll. SO that totally explains why nothing changed, and why you got the Unable to load file or assembly 'Swift, Version=9.0.97.2071 error. You need to rebuild your swift project against the new .dll Carlo gave you.

Now, as for why it doesn’t compile, hard to say. the sample project you sent be originally of course did compile for me, here, with the latest dll. Can you send me the exact/new project that you;re seeing the errors with with the new dll?

i’ve also set you up with access to the beta, so you can download the full .2131 build from last friday (but that probably wont solve the issue, so it’d still be good if i can get the project that fails to build).

thanx,
marc

(just confirmed again, ClassLibrary.zip3 (685.9 KB) compiles fine for me, with latest)

Sending you the full project.
ClassLibrary.zip (127.9 KB)

Ps.: the reason everything is in one file is because I’m using the same code in Xcode, so it’s easier to just copy and paste.

i’m getting one error. investigating.

	return user.currentLoans.map({ (currentLoan) -> CurrentLoanOptions in // E62 Type mismatch, cannot assign "IEnumerable<CurrentLoanOptions>" to "Array<CurrentLoanOptions>"

yeah, the problem is that map returns a sequence, not an array.

this

func calculateCurrentLoanOptions(user: User) -> ISequence<CurrentLoanOptions) {
	return user.currentLoans.map({ (currentLoan) -> CurrentLoanOptions in

will work, but ofc there’s a ripple effect for that API change.

we deliberately changed what map returns because, frankly. Swift was was desiged by someone who doesn’t understand interfaces/protocols, and having map return a sequence is much more efficient and consistent.

But even when I use my own map which returns an array, I still get errors.


Hard to say, i can only judge for the code i got, nit code that uses some imaginary APIs i can’t see ;). Also your screenshot cuts off the error messages, which also doesn’t help. But i’m guessing it doesn’t like the -> before the in — what is that supposed to mean? it looks like you’re trying to pass a closure TO the closure, as first parameter? that (a) seems wrong, but (b) needs parenthesis around the two parts.

You have that API in the code I sent you.
The -> is the default Swift syntax to specify the type of the closure.
And only the first image is cutting off, because it wasn’t that important, complaining about not having parenthesis.

This compiles for me:

ClassLibrary 2.zip (126.4 KB)

Well, you asked about errors you got and then posted an image where the message was cut off. silly me for thinking that was relevant…

My bad, sending you the new image.

Is there a way for me to use my default Swift code?
As in not use ISequence.

out map function will return a sequence, so you can use that exact combo. you’ll have to either use your one map, or deal with it returning a sequence instead of an array (and, say, call .ToList() on the result to convert it).

http://beta.remobjects.com

Hi, it took me a while to reply because I was doing some testing to figure out the problem.

Does Fire support the reduce method of arrays?