A number of overloads were added to `detectKnownDeclaration()` to allow it to support `null` being passed through. In practice this could easily be avoided, which allows the overloads to be removed and the method signature and implementations to be simplified. PR Close #36989