[squeak-dev] The Trunk: Compiler-ct.469.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 7 21:19:51 UTC 2022


Christoph Thiede uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-ct.469.mcz

==================== Summary ====================

Name: Compiler-ct.469
Author: ct
Time: 7 February 2022, 10:19:35.139791 pm
UUID: 82deaae4-e9ba-7341-aef8-8272397ba297
Ancestors: Compiler-ct.468, Compiler.ShadowedVariableNotification-ct.468

Merges and documents Compiler.ShadowedVariableNotification-ct.468.

=============== Diff against Compiler-ct.468 ===============

Item was changed:
  ----- Method: Encoder>>warnAboutShadowed: (in category 'private') -----
  warnAboutShadowed: name
+ 
  	requestor addWarning: name,' is shadowed'.
+ 	selector ifNil: [^ self].
+ 	(ShadowedVariableNotification new
+ 		name: name
+ 		selector: selector
+ 		class: cue getClass) signal.!
- 	selector ifNotNil:
- 		[Transcript cr; show: cue getClass name,'>>', selector, '(', name,' is shadowed)']!

Item was added:
+ Notification subclass: #ShadowedVariableNotification
+ 	instanceVariableNames: 'name selector class'
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Compiler-Support'!
+ 
+ !ShadowedVariableNotification commentStamp: 'ct 2/7/2022 22:18' prior: 0!
+ I tell interested exception handlers or the Transcript about an attempt to compile a method with a shadowed variable, i.e., a temporary variable that has the same name as an existing instance variable in the subject class. The use and usage of shadowed variables are generally disputed: They can lead to confusion when a temporary variable declaration is missed, but they can also be utilized to make an instance variable unaccessible in a local scope.!

Item was added:
+ ----- Method: ShadowedVariableNotification>>defaultAction (in category 'handling') -----
+ defaultAction
+ 
+ 	Transcript showln: ('{1} ({2} is shadowed)' translated format:
+ 		{self methodClass name , '>>' , self selector.
+ 		self variableName}).!

Item was added:
+ ----- Method: ShadowedVariableNotification>>methodClass (in category 'accessing') -----
+ methodClass
+ 
+ 	^ class!

Item was added:
+ ----- Method: ShadowedVariableNotification>>name:selector:class: (in category 'initialize-release') -----
+ name: aString selector: aSymbolOrNil class: aBehavior
+ 
+ 	name := aString.
+ 	selector := aSymbolOrNil.
+ 	class := aBehavior.!

Item was added:
+ ----- Method: ShadowedVariableNotification>>selector (in category 'accessing') -----
+ selector
+ 
+ 	^ selector!

Item was added:
+ ----- Method: ShadowedVariableNotification>>variableName (in category 'accessing') -----
+ variableName
+ 
+ 	^ name!



More information about the Squeak-dev mailing list