STA proving that God knows things that do not exist:
Since the intelligence of God, which is his being, is measured by eternity – which without succession comprehends the whole of time – the intuition of God in his “now” (presens intuitus) bears on the whole of time and on all things that are in any time as on a subject existing for it in the present.
cum intelligere Dei, quod est eius esse, aeternitate mensuretur, quae sine successione existens totum tempus comprehendit, praesens intuitus Dei fertur in totum tempus, et in omnia quae sunt in quocumque tempore, sicut in subiecta sibi praesentialiter.
St. Thomas thus says God knows either possible things that at some time are (by “vision”) or possible things that at no time are (“mere understanding”.) These second kind are located among those “things in the power of God or a creature”. This remark is crucial: St. Thomas’s whole theory is being structured around the reality of action, that is, the reality of making something be. The only reason to include such a remark is because “what is not at any time” is only knowable through the reality of the power of God or a creature. Without such a reference to the reality of action, non-being is absolutely unintelligible to any intelligence, to God as well as us. It cannot be known because there is no such thing to know.
For those of us who know everything by the principle of contradiction, this is important to remember, since we only know being by opposing it to what is not. The reality of action or of making be is inseparable from the notion of being.