What is this error: Type mismatch, cannot find operator to evaluate "guardian.bll4.Person.LoginResultWeb" = "nil"

Here is the code:

  var loginresult := guardian.bll4.Person.LoginValidateWeb( username, password, false, useTempAdmin, siteID.ToString );

  if loginresult = nil then exit nil;

I can’t see what is wrong with this (and it compiled in the old Delphi Prism).

Here is what the metadata says about the routine:

class method LoginValidateWeb(username: System.String; password: System.String; hashed: System.Boolean; tempAdmin: System.Boolean; database: System.String): guardian.bll4.Person.LoginResultWeb;

So it looks like it just returns an object and I can’t compare to nil?

… time passes …

As far as I can tell, it is a C# Struct. I guess maybe you can’t compare to nil.

That makes sense though? Structs can’t be nil

ok, I got rid of the test for nil. I NEVER use Structs so wasn’t familiar.