0

I know that there's already been a thread like this but I've tried everything that was suggested and the error is still showing in the editor but the solution compiles okay. My problem might be a bit different though.

I have a function called getCurrentTime with the same name, defined in two separate files and inherited to different classes. This is how it looks: enter image description here

enter image description here

NetworkClientState uses getCurrentTime from the NetworkClient base class. GameClient as well as LinearPrediction and QuadraticPrediction all use getCurrentTime define in the Prediction base class.

Intellisense persist on underscoring Prediction::getCurrentTime but the program compiles and runs. Although it will say that getCurrentTime is ambiguous if I get rid of using NetworkClient::getCurrentTime. What could I do to get rid of this Intellisense error?

matzar
  • 287
  • 2
  • 19
  • 4
    This is obviously a bug in IntelliSense. The only solution is to either ignore it or upgrade your IDE (Visual Studio 2017 has been available for a long while already). That said, you should create a [MCVE] if issue persists in the newest IDE version and then report it through the appropriate channels. – tambre Nov 26 '17 at 18:01
  • Remember IntelliSense is a separate compiler that is optimized for speed not necessarily accuracy. It will have false positives. – drescherjm Nov 26 '17 at 18:08
  • Why do you use Prediction? You don’t derive from it. –  Nov 26 '17 at 19:08
  • Why is getCurrentTime a member of any class? The name suggests that it should be a free function. –  Nov 26 '17 at 19:11
  • Thanks all for your comments! I'll try VS2017 and see what happens. Cheers! – matzar Nov 26 '17 at 19:24
  • @carrotcake, it is works fine in VS 2017? – Sara Liu - MSFT Nov 27 '17 at 09:12
  • @sara-liu-msft I deleted last comments because after compiling the project the error still persists in VS2017. – matzar Nov 27 '17 at 16:17
  • @tambre the error still persists in VS2017. – matzar Nov 27 '17 at 16:18
  • @carrotcake Make sure to delete the hidden `.vs` directory for the solution to force a re-index. If the problem persists, then create a [MCVE]. – tambre Nov 27 '17 at 16:19
  • @tambre problem solved! Also, I've changed my application so `getCurrentTime` is in one file now and I'm no longer overloading it. – matzar Nov 27 '17 at 23:09

1 Answers1

0

I've managed to solve it by popping Prediction::getCurrentTime into the .cpp file and then just removing the declaration from the header file. The error was probably popping up because of the multiple inheritance.

matzar
  • 287
  • 2
  • 19