fixed a compiler bug in handling 'super' with multiple messages sent at the same time as in 'super abc + 10'

This commit is contained in:
hyunghwan.chung
2018-05-25 10:19:25 +00:00
parent 90e6e6c8cf
commit d1cfaed466
4 changed files with 39 additions and 10 deletions

View File

@ -302,7 +302,8 @@ class OrderedCollection(SequenceableCollection)
method(#class) new: size
{
^self _basicNew initialize: size.
| x |
^super basicNew initialize: size.
}
method initialize: size
@ -325,7 +326,7 @@ class OrderedCollection(SequenceableCollection)
Exception signal: ('index ' & index asString & ' out of range').
}
method at: index put: obj
method at: index put: obj
{
| i |
i := index + self.firstIndex.
@ -429,6 +430,24 @@ System log(System.Log.FATAL, S'REMOVING ... ', obj, '--->', self.lastIndex, S'\n
self.firstIndex := self.firstIndex + shift_count.
self.lastIndex := self.lastIndex + shift_count.
}
method insert: obj at: index
{
## internal use only - index must be between 0 and self size inclusive
| i start |
if (self size == self.contents size) { self growBy: 8 shiftBy: 8 }.
start := self.firstIndex + index.
i := self.lastIndex.
while (i > start)
{
self.contents at: i put: (self.contents at: i - 1).
i := i - 1.
}.
self.lastIndex := self.lastIndex + 1.
self.contents at: index + self.firstIndex put: obj.
^obj
}
}
## -------------------------------------------------------------------------------

View File

@ -254,7 +254,7 @@ class Socket(Object) from 'sck'
method(#class) __with: handle
{
###self addToBeFinalized.
^(self _basicNew initialize) __open(handle)
^(self basicNew initialize) __open(handle)
}
method(#class) family: family type: type
@ -263,7 +263,7 @@ class Socket(Object) from 'sck'
## new is prohibited. so use _basicNew with initialize.
##^(self new) open(family, type, 0)
^(self _basicNew initialize) open(family, type, 0)
^(self basicNew initialize) open(family, type, 0)
}
method close
@ -308,7 +308,7 @@ class SyncSocket(Socket)
method(#class) __with: handle
{
###self addToBeFinalized.
^(self _basicNew initialize) __open(handle)
^(self basicNew initialize) __open(handle)
}
method(#class) family: family type: type
@ -317,7 +317,7 @@ class SyncSocket(Socket)
## new is prohibited. so use _basicNew with initialize.
##^(self new) open(family, type, 0)
^(self _basicNew initialize) open(family, type, 0)
^(self basicNew initialize) open(family, type, 0)
}
method initialize