initialization of element is conditional (in the or: block). I'm amazed, that's a new behavior, is it a consequence of using AST? But a dumb compiler not knowing the semantic of or: (it is a message like others) could conclude that element may be used uninitialized in the whileFalse block... A compiler that is inlining or: with a well known semantic has no excuse ;)
2016-08-16 22:12 GMT+02:00 stepharo <[email protected]>: > While browsing the system I saw that the following method raised a temp > read before written... > > It did not jump to my eyes. Working on something else.... > > > PositionableStream>>upTo: anObject > "Answer a subcollection from the current access position to the > occurrence (if any, but not inclusive) of anObject in the receiver. If > anObject is not in the collection, answer the entire rest of the > receiver." > | newStream element | > newStream := (collection species new: 100) writeStream. > [self atEnd or: [(element := self next) = anObject]] > whileFalse: [newStream nextPut: element]. > ^newStream contents > > >
