As the title implies, are there any differences between just "inherited;" and "inherited MethodName;"?
Yes, there is a difference.
First (as pointed out by others), you need to understand that you can use "inherited name(...)" to call any method of the parent class (including those that the parent class has inherited).
- You can call "inherited Foo", even if you call from a method that is not called "Foo".
- You can use "inherited name(...)" in any method. Even in a method that is NOT virtual/overridden.
Second, "inherited" without any name or function, is
NOT identical to "inherited CurrentFunctionName(ArgsFromCurrentFunc)"
You can call "inherited" even if the parent class has no function of the same name. In that case the "inherited" is silently ignored.
If the parent class has (either by itself or inherited) a method of the same name (and params), then "inherited" is a shortcut for "inherited CurrentFunctionName(ArgsFromCurrentFunc)". And it will do the same thing.
However if you remove/rename the method in the parent, and you used the short "inherited", then you get no error if you forget to update the child class.