GemTalk / Rowan

a new project/package manager for Smalltalk that supports FileTree and Tonel repositories, and is independent of Monticello and Metacello
MIT License
14 stars 7 forks source link

save method in method in UnPackaged-Globals got 'expected Character Collection error' #849

Open ericwinger opened 2 years ago

ericwinger commented 2 years ago

Not sure if this is a reproduction case, but here is what I did right before getting the error.

Using Jadeite 3.2.9, RowanClientServices 3.0.1

methodToStopIn

    | abc theSize |
    abc := OrderedCollection new. 
    abc add: 'foo'; add: #foo. 
    theSize := abc size. 
    abc do:[:thing |
    |blah |
    blah := thing]. 
    theSize = 2 ifTrue:[abc add: 400]. 
    ^abc

20220819_expect_CharacterCollection_rowan_walkback.txt

The method source argument was a String.

ericwinger commented 2 years ago

Here's what my browser looked like in case my issue report isn't clear enough. image

ericwinger commented 2 years ago

Looks like somehow, my RwGsPatchSet_V2>>loadSymbolList has two symbol dictionaries without names in them. That seems to be the immediate problem in RwGsPatchSet_V2>>_createNewSymbolList. Not sure why the method's temp vars have their own symbol dictionary though.

1: aSymbolDictionary( #'theSize'->nil, #'abc'->anOrderedCollection( ))
2: aSymbolDictionary( #'theSize'->nil, #'abc'->anOrderedCollection( 'foo', #'foo', 400))
3: aSymbolDictionary( name: #'UserGlobals' )
4: aSymbolDictionary( name: #'Globals' )
5: aSymbolDictionary( name: #'Published' )
6: aSymbolDictionary( name: #'RowanKernel' )
7: aSymbolDictionary( name: #'RowanLoader' )
8: aSymbolDictionary( name: #'RowanTools' )
9: aSymbolDictionary( name: #'RowanClientServices' )
dalehenrich commented 2 years ago

I don't think that we need to worry about interacting with UNPACKGED guys they are going away and any problems will go away with them :)

rjsargent commented 2 years ago

I dealt with this same issue just a moment ago. It turns out that if you evaluate an expression from the debugger window, the debugger adds a new symbol dictionary to the front of the symbol list with the (I think) variables in the frame. The problem is that the symbol dictionary is unnamed. RwGsPatchSet_V2 >> _createNewSymbolList thinks only named symbol dictionaries will be found. This is not the first time I have seen problems that assume every symbol dictionary is named.

I think having the debugger name the symbol dictionary might be a good idea anyway. e.g. a combination of the word debugger and the process' id, so that multiple debuggers won't be fighting over what they think is theirs.

ericwinger commented 2 years ago

Ahh, so Jadeite might be contributing. As you suggested, I added a name to the symbol dictionary added by the debugger during an ad-hoc execution. The name is 'DebuggerExecution'.

I'll close this issue.

dalehenrich commented 2 years ago

reopening and assigning to me ... I am surprised to see that symbol dictionaries are creating symbol dictionaries on the fly and am wondering about whether this makes sense or not, especially when RwGsPatchSet_V2 >> _createNewSymbolList is involved in ad-hoc execution ... not a red flag, but the yellow light is blinking :smile: