Project migrated to Mercury throws several build errors

As mentioned previously, I’ve been experimenting with migrating one of my solutions to Mercury. The solution has 11 projects, but I’m only on the 2nd project. This project mostly contains code generated by LLBLGen, which is something on almost everything I create, so getting this working successfully is important for me if I’m going to be using Mercury for any of my existing projects.

Unfortunately right now now I am unable to build successfully, There are 8 different types of errors:

  • (E373) No overload with 0 parameters, expected 1
  • (E406) No overloaded method “xxxxxxx” with these parameters…
  • (E46) Unknown identifier “$WithVar”
  • (E576) Cannot access member on expression without result type
  • (E62) Type mismatch, cannot assign “xxxx” to “Int32”
  • (E626) Member “yyyy” of type sequence “xxxx” is a variable but is used as a method
  • (E64) Type mismatch, cannot find operator to evaluate “Byte” = “xxxx”
  • (E714) No “With” statement found for this expression

Maybe some of these are tied to the same underlying issue, but I suspect most of these are independent issues.

Previously I’ve been trying to create sample projects that clearly demonstrate each issue I encounter but I’m starting to wonder if it would be more useful if I just provide you with this project. I don’t have to send the whole solution - I have a modified solution that has only 2 projects and a fairly limited set of external references.

Let me know if you think this makes sense. Otherwise I will continue as I have been, reporting bugs with sample projects as time permits.

Thanks!

–Avonelle

That’d be fine for this; yes; I can see if I can isolate the issues, or just pass the whole project on to the team for the bug report, if I can’t. If you do not want to share this code publicly here you can email it to support@remobjects.com.

Sounds good, I will zip it up and send it via email. Thanks!

–Avonelle

1 Like

Thanks, logged as bugs://85567

Spinning a few separate bug repairs off from this…

Thanks, logged as bugs://85568

for

Return New StoredProcedureCall(dataAccessProvider, "[Kandor].[dbo].[FindContacts]", "FindContacts") _ 
.AddParameter("@OrganizationID", "Int", 0, ParameterDirection.Input, True, 10, 0, organizationID) _	
// E714 No "With" statement found for this expression																																																						
.AddParameter("@RestrictToViewedByContact", "Int", 0, ParameterDirection.Input, True, 10, 0, restrictToViewedByContact) _	
// E46 Unknown identifier "$WithVar"

For the matching overload, what is

Dim x = New System.String() {  } // E373 No overload with 0 parameters, expected 1

supposed to do?

both of these fail for me:

Dim x = New System.String() {  } // E373 No overload with 0 parameters, expected 1

Dim x = New System.String() // E319 No overloaded constructor with 0 parameters for type "System.String"
                            // H15 Best matching overload is "String (value: array of Char)"

and indeed they seem correct, I see no public constructor on System.String w/o parameters:

  Public Sub New(c As [Char], count As Integer)
  Public Sub New(value As [Char]())
  Public Sub New(value As [Char](), startIndex As Integer, length As Integer)
  Public Sub New(value As Ptr(Of Byte), startIndex As Integer, length As Integer, enc As System.Text.Encoding)
  Public Sub New(value As Ptr(Of Byte), startIndex As Integer, length As Integer)
  Public Sub New(value As Ptr(Of Byte))
  Public Sub New(value As Ptr(Of [Char]), startIndex As Integer, length As Integer)
  Public Sub New(value As Ptr(Of [Char]))

is this VB special sauce? what does it create, an empty string? or an empty string array?

Thanks, logged as bugs://85569

for new String() {}

This on’;es a strange one:

					_Activities = CType(linqmeta.GetQueryableForEntity(Kandor.Data.EntityType.ActivityEntity), IQueryable(Of Global.Kandor.Data.EntityClasses.ActivityEntity)) 

// E406 No overloaded method "GetQueryableForEntity" with these parameters on type "LinqMetaData", best matching overload is "GetQueryableForEntity(typeOfEntity: Int32): SD.LLBLGen.Pro.LinqSupportClasses.IDataSource"
																																																																																		 // H3 parameter 1 is "EntityType" should be "Int32"

it seems like we cant cast Enums to to Integer implicitly, I assumer thats something VB allows, with <VBOptionStrict>Off</VBOptionStrict>, (which your project does have)?

Thanks, logged as bugs://85571

For Enum->Int

I think that’s the three big ones; lets get these fixed and then I’ll evict if I missed something.

I see a lot of “case mismatch” warnings too; I assume those are expected (ie maybe VB just didn’t warn on those, by default)?

That assumption is correct.

The matching C# syntax:

var x = new System.String[] { };
1 Like

thanx for confirming.

Thanks for answering some of these, Theo!

This is where I started to think that maybe I should just send you the project. I hadn’t quite figured out WHY I was getting those “Type mismatch” errors, and I couldn’t replicate it with my sample test project. But that definitely wasn’t an issue before switching to Mercury. I had thought it was related to the fact that the Enum definition actually doesn’t provide a type (this is by design - a library I am using with this doesn’t handle the enums the way I would like unless they are defined without a type), but that may not be the case. But you may be right - it may be as simple as VB not warning on those by default. I’m pretty sure I don’t see errors or warnings on this on the original pre-Mercury project when on build, but I can give it a try again to see for sure.

–Avonelle

I meant the case mismatch warnings.

The type mismatches are definitely due to the enumj/int casting; I assume thats an Option Strict Off thing. @Theo69, can you confirm?

Oh, I wasn’t seeing those, “Warn on Case Mismatch” was turned off for me. Gotcha.

–Avonelle

1 Like

bugs://85569 got closed with status fixed.

bugs://85568 got closed with status fixed.

bugs://85571 got closed with status fixed.