By “red lines” do you mean the squiggle lines where Intellisense detects errors?
I use Visual Assist, and generally have Intellisense turned off, so I don’t see these squiggles. In general, any Intellisense errors can be ignored. The code that you provided is fine, and shouldn’t provide any actual problems. With Intellisense enabled however, you are likely to see a large number of “errors” in the Error List.
None of these errors will prevent the project from building successfully, though. Intellisense tends to have a difficult time with large code bases, such as UE4, and the large amount of reflection that takes place in the Unreal Build Tool when building a project in Visual Studio doesn’t help either. As you use the Engine, you will learn what errors are actually important, and which ones can be safely ignored.
So in this case it wasn’t the fault of Intellisense but Resharper (Jetbrain VisualStudio Extension). When i disable Code Inspection the squiggle are gone. Unfortunately i couldn’t find the setting for this particular error so i have to turn it off completely. Thanks for the help.
Your can also exclude some files from analysis to remove “wrong” errors in certain files.