I have never known a compiler make a 'guess', they just compile your set of instructions, just as you expressed them. A guess involves some level of intelligence and being aware of the alternatives, which a compiler simply doesn't possess.
As I said, very few do, but I gather that some have tried.
The nearest I am aware of that in relation to software I commonly use is its fairly trivial ability to make assumptions (aka 'guesses') in relation to simple/common typographical errors, but only in situations in which it is essentially impossible that this assumption/guess will result in something that the programmer did not intend. The following extracts from the log illustrate. Firstly, with the correct code:
592 proc print data = test ; run ;
NOTE: There were 100 observations read from the data set WORK.TEST.
In general, if one types the first word of that code ("proc") incorrectly, the compiler will throw up an error message and abort compilation (of the step):
598 prkk print data = test ;
----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
However, if one 'gets fairly close' to typing the word correctly, it merely issues a 'warning', indicating its assumption, but continues with compilation (and subsequent execution) on the basis of that assumption:
594 prok print data = test ; run ;
----
14
WARNING 14-169: Assuming the symbol PROC was misspelled as prok.
NOTE: There were 100 observations read from the data set WORK.TEST.
596 prox print data = test ; run ;
----
14
WARNING 14-169: Assuming the symbol PROC was misspelled as prox.
NOTE: There were 100 observations read from the data set WORK.TEST.
That really carries virtually no 'risk', since there is no syntactically-correct meaning that the programmer could possibly have intended other than what is 'assumed' by the compiler.
What some languages
do do (with the disapproval of many professionals!) is allow one to configure the compiler to allow all sorts of 'imprecise programming' - which amounts to allowing the compiler to make assumptions'. Probably the best known example is VB.NET, if one specifies "Option Strict Off". That provides compatibility with VB6 etc. and, for non-professionals like myself, enables one to write simpler code much more easily, but it also opens the door for 'programming errors/oversights', which is why many disapprove of it!
Kind Regards, John