This is unrelated to the code that you added, it’s a C# problem linked to UnrealBuildTool. It could be a problem with Mono, or with the conversion of a 4.8 project to 4.9. Try to reinstall UE4 4.9 from a clean base.
I’m getting exactly the same error. Unreal Engine 4.9.2, OS X 10.10.5. I’m just following the tutorial at 3 - Write and Compile C++ Code | Unreal Engine Documentation, with a new project. That error comes up in the log when pressing the Compile button inside UE.
I fixed this by commenting out the line that says “PrivateDependencyModuleNames.AddRange(new string] { });” in Source/MyProject/MyProject.Build.cs. The empty array of dependencies here was obviously causing PatchActionHistoryForHotReloadAssembling to fail.