Convert a given path to name.
@param {symbol} type The report type.
@param {string[]} path The property access path.
@returns {string} The name.
function toName(type, path) {
    const baseName = path.join(".")
    return type === ReferenceTracker.CALL
        ? `${baseName}()`
        : type === ReferenceTracker.CONSTRUCT
            ? `new ${baseName}()`
            : baseName
}