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

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


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

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

Name: Compiler.ShadowedVariableNotification-ct.468
Author: ct
Time: 30 January 2022, 11:59:29.001979 pm
UUID: 81ba565a-ad5f-724e-9eb9-6f865176ec5f
Ancestors: Compiler-mt.467

Adds a ShadowedVariableNotification for the compiler to notify clients about shadowed variables. Later, we could upgrade this notification to a parser notification or something else.

See: http://lists.squeakfoundation.org/pipermail/squeak-dev/2022-January/218509.html

=============== Diff against Compiler-mt.467 ===============

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'!

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