[squeak-dev] The Trunk: Tools-ct.1174.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Sep 9 20:59:27 UTC 2022


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

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

Name: Tools-ct.1174
Author: ct
Time: 9 September 2022, 10:59:25.805395 pm
UUID: c6e6fc87-b341-c940-8993-c72b2a6bc5e4
Ancestors: Tools-ct.1171

Fixes slip in browser when defining a trait over a selected class.

=============== Diff against Tools-ct.1171 ===============

Item was changed:
  ----- Method: Browser>>defineTrait:notifying: (in category 'traits') -----
  defineTrait: defString notifying: aController  
  
  	| defTokens keywdIx envt oldTrait newTraitName trait |
  	oldTrait := self selectedClassOrMetaClass.
+ 	oldTrait isTrait ifFalse: [oldTrait := nil].
  	defTokens := defString findTokens: Character separators.
  	keywdIx := defTokens findFirst: [:x | x = 'category'].
  	envt := self selectedEnvironment.
  	keywdIx := defTokens findFirst: [:x | x = 'named:'].
  	newTraitName := (defTokens at: keywdIx+1) copyWithoutAll: '#()'.
  	((oldTrait isNil or: [oldTrait baseTrait name asString ~= newTraitName])
  		and: [envt includesKey: newTraitName asSymbol]) ifTrue:
  			["Attempting to define new class/trait over existing one when
  				not looking at the original one in this browser..."
  			(self confirm: ((newTraitName , ' is an existing class/trait in this system.
  Redefining it might cause serious problems.
  Is this really what you want to do?') asText makeBoldFrom: 1 to: newTraitName size))
  				ifFalse: [^ false]].
  
  	trait := envt beCurrentDuring:
  		[Compiler evaluate: defString in: envt notifying: aController logged: true].
  	^(trait isTrait)
  		ifTrue: [
  			self changed: #classList.
  			self classListIndex: (self classListIndexOf: trait baseTrait name).
  			self clearUserEditFlag; editClass.
  			true]
  		ifFalse: [ false ]
  !



More information about the Squeak-dev mailing list