Project migrated to Mercury throws several build errors

Your project is down to just the Enum/Int issue (being worked on now) and one new error (or one I didn’t see before):

			If records.Count > 0 Then
				Return records(0) // E626 Member "records" of type "sequence of RelationshipEntity" is a variable but is used as a method
			Else
				Return Nothing
			End If

this seems valid, record is an ISequence, and this should not be indexable!?

Thanks, logged as bugs://85584

That’s great to hear!

I’m not sure I’m following your question, and unfortunately I’m on my way out the door. But if this helps: records is a type of collection, and there is a default property of Item(index of integer). Because it is a default property, instead of syntax:

records.Item(0)

I can just shorthand it with:

records(0)

Does that help?

–Avonelle

Yeah, this seams to be an Option Strict Off hack; I’ve logged to add it, but this is a really bad idea. (0) is fine, but imagine doing this in a for loop — an IEnumerable doesnt provide random access, so the sequence has to be reiterated for each access…

Good point!

That being said, I probably use that syntax more than I should. Option Strict On is something I keep assuming is already on for my projects, but isn’t necessarily, especially for this type of project which is initially created by LLBLGen. But I really should make sure it is turned on everywhere and clean up my code faux pas.

Assuming that it isn’t used in the code generated by LLBLGen (and I don’t think it is), it is less of an issue for me to change my own code.

–Avonelle

In your case. replacing record(0) with record.First() did the trick, and your solution now compiles clean for me with latest, after that change. What we’ll did, compiler side is translate sequence(x) to sequence.Skip(x-1).First.

I can send you a new build with the other fixes (not the sequence one) in a short while.

1 Like

That would be fantastic, thanks!

Then I can take a peek at the rest of the projects in this solution, and see how they fair with a switch to Mercury.

–Avonelle

1 Like

Up.

Great - I will download now!

–Avonelle

1 Like

FYI - the updates worked great for me, much better now, thank you very much!

–Avonelle

2 Likes

happy to hear!

bugs://85567 got closed with status fixed. (that was the meta issue)