His typo . There is no reason to reassign value to yourself in your case.
Side note: However, if you just write
double x = x;
Then the compiler also gives a warning :

In your case, it will take the value from the right operand and therefore it will be compiled and there will be no problems, but it does not make any real sense. Perfect demonstration
source share