Strict Symbol Comparison with literals

This is the scenario where an expression is compared to a literal, e.g.:

        
myVar = #symbol.
aParameter = 'a string'.
myVar with message send = 'a literal'.
        
      

There are three general approaches we plan to take in this scenario:

Assume that the variable expression doesn't change type

In this case the left expression in the example above is assumed to always be either a String or Symbol as appropriate. The equality test can be left as is, and a check made that the assumption is correct a method taking a parameter would modified to be:

        
method1: aSymbol

	self assertIsStringWhenStrict: aSymbol.
	^ aSymbol = #onetwothree
        
      

It's possible in this scenario that the literal is of the wrong type, in which case it will obviously need to be converted.

Allow for either type in the comparison

In this case the left expression above may be either a String or Symbol, and the Pharo behaviour is desired, even if strict symbol comparison is enabled. The equality check is then replaced with #sameContentAs::

        
method1: aStringOrSymbol

	^ aStringOrSymbol sameContentAs: #onetwothree