[Pharo-project] Issue 3685 in pharo: #createUserSubclass:instVarNames:categoryName: no longer accepts an inst var array

pharo at googlecode.com pharo at googlecode.com
Mon Feb 7 23:59:16 CET 2011

Status: New
Owner: ----

New issue 3685 by ya... at rogers.com:  
#createUserSubclass:instVarNames:categoryName: no longer accepts an inst  
var array

Pharo core version:
   Latest update: #12324

In Pharo1.1 the instance variables could be passed as an array. See  
attached testcase, or, for example:

   SomeClass createUserSubclass: 'SomeSubclass' instVarNames: #(id varOne  
varTwo) categoryName: 'Test'.

The code change here, looks to be the cause:

ClassBuilder>>name: className inEnvironment: env subclassOf: newSuper type:  
type instanceVariableNames: instVarString classVariableNames:  
classVarString poolDictionaries: poolString category: category unsafe:  

<	instVars := instVarString subStrings: ' '.
<	classVars := (classVarString subStrings: ' ') collect: [ :x | x asSymbol  
].	"Validate the proposed name"
> 	instVars := Scanner new scanFieldNames: instVarString.
> 	classVars := (Scanner new scanFieldNames: classVarString) collect: [ :x  
> | x asSymbol ].	"Validate the proposed name"

This issue came up in some code that was originally derived from some  
GemStone code. Maybe it was never intended that instVarNames could be  
passed in as an array. I've changed my code to pass an instVarString, but I  
thought I'd mention the changed behaviour here.

	ClassBuilderFormatTests-testSubclassWithInstanceVariablesArray.st  565  

More information about the Pharo-project mailing list