Server Reliable WithValidation compilation mistery

Something very strange is happening. This compiles just fine:

in DarwinCharacter.h :

public:
  UFUNCTION(Server, Reliable, WithValidation)
  void ServerSetStealthX(bool stealth_on);

in DarwinCharacter.cpp :

void ADarwinCharacter::ServerSetStealthX_Implementation(bool stealth_on)
{	
	bStealthOn = stealth_on;
}

bool ADarwinCharacter::ServerSetStealthX_Validate(bool stealth_on)
{
	return true;
}

But this does not (the only difference is the X in the name of the function) :

in DarwinCharacter.h

public:
  UFUNCTION(Server, Reliable, WithValidation)
  void ServerSetStealth(bool stealth_on);

in DarwinCharacter.cpp :

void ADarwinCharacter::ServerSetStealth_Implementation(bool stealth_on)
{	
	bStealthOn = stealth_on;
}

bool ADarwinCharacter::ServerSetStealth_Validate(bool stealth_on)
{
	return true;
}

I get these errors everytime DarwinCharacter.h is included somewhere:

DarwinCharacter.h(15): error C2039: 'ServerSetStealth_Validate': is not a member of 'ADarwinCharacter'
DarwinCharacter.h(13): note: see declaration of 'ADarwinCharacter'
DarwinCharacter.h(15): error C2039: 'ServerSetStealth_Implementation': is not a member of 'ADarwinCharacter'
DarwinCharacter.h(13): note: see declaration of 'ADarwinCharacter'

Lines 13 and 15 are :

class ADarwinCharacter : public ACharacter
{
	GENERATED_BODY()

I tried deleting everything in Build, Binary, Intermediate, DerivedDataCache, Saved, also deleting Darwin.VC.db, Darwin.sln and regenerating project files, and rebuilding (clean and rebuild all) the solution and still the exact same error. It compiles with the X and not without. Changing just those 3 characters makes it not compile. There is no other function with that name either. In the entire solution.

I am using the latest (Merging final 4.12.5 release a208e88) engine source.
My visual studio info is

Microsoft Visual Studio Community 2015
Version 14.0.25123.0 D14REL
Visual C++ 2015   00322-20000-00000-AA079

I’m stumped.

I’ll answer my own question, I figured it out.

in DarwinCharacter.h I had this :

public:
  UFUNCTION(Server, Reliable, WithValidation)
  void ServerSetStealth(bool stealth_on);
  //virtual void ServerSetStealth_Implementation(bool stealth_on);
  //virtual bool ServerSetStealth_Validate(bool stealth_on);

notice the commented out lines, which were uncommented in my first iteration of the code because I was not certain if I had to declare those functions outright. Then after reading the doc Server Replication I figured I did not need them, so I started writing server functions without declaring the Implementation and Validate. After a few weeks, when I was cleaning my code, comning back to the DarwinCharacter class, I noticed the Implementation and Validate of ServerSetStealth were still explicitly declared. When I clean out code I comment out a bunch of stuff, I compile and test to make sure I did not break anything, then I erase the commented stuff. This time I got stuck on the compile step, the code did not want to compile with the commented out functions. It worked when I changed the name of the function to ServerSetStealthX, but not with the original name. I did not think to include the commented out lines in my question because with years of experience my brain doesn’t see commented stuff as really there, as stuff that can influence the compiler. To cut to the chase: if you remove the commented out lines everything compiles just fine. The parser gets confused for some reason. Must be all those macros in Unreal 4 C++ that screw things up. Also it doesn’t matter if you use C style comments, this:

/*virtual void ServerSetStealth_Implementation(bool stealth_on);
virtualbool ServerSetStealth_Validate(bool stealth_on);*/

doesn’t compile. Hell, even this:

//ServerSetStealth_Implementation
//ServerSetStealth_Validate

doesn’t compile. And it doesn’t matter where in the class declaration you put it, as long as it’s in between the { } class delimiters it will not compile. I’m leaving this here so that if it happens to anyone else they can know how to fix it.