PowerApps seems to be confused with variable definitions. In Link 1, users of PA are noting that their navigation formulas are not working because the variable passed is encountering errors even though they had not edited the app. In Link 2, I reported that PA slows down when you are in the middle of typing a formula for an existing variable. Both problems have to do with the definition of a variable. It is not clear to us how PowerApps prioritizes definitions of variables--is there a hierarchy we can view?
I am suggesting that there be a location in PA where you could define a variable and the kind of data it is validated for. When typing formulas, PA would check against that original definition as a priority. Uses of the variable that match that original definition will be okay while anything that does not match the original definition would appear with the yellow sign.
So if you are in the middle of typing a formula:
and the variable already exists elsewhere for taking boolean values, you would normally break every control that references the variable since they no longer think it takes boolean values. If you have an original definition that takes precedence, everything that relies on the variable would not have yellow error signs; only the most recent formula that doesn't match the original definition would have the error.
I predict that this would resolve performance issues described in Link 2 since the original definition would remain strong. I think it would also avoid issues with passing variables between screens as described in Link 1 (though I still recommend Set() instead of passing variables).
Is this doable? What is the existing hierarchy for which definition of a variable is prioritized?