[Pharo-project] CodeMorph >> text should return an instance of Text but return a String

Cyrille Delaunay cy.delaunay at gmail.com
Fri Oct 1 05:58:14 EDT 2010

In pharo 1.2, NewTextMorphTests>>#testFullMethodName raise an error.
This error happen when calling:

   CodeMorph >> defaultStyledText
	| text attribute |
	text := self text.
	text addAttribute: ( self newTextColorAttribute: Color black ).
	^ text.

text is a string, and therefore it does not understand 'addAttribute'.
The value return by 'text' depends on the value of the instance
variable 'adapter'. adapter can have different values according the
way we initialize the CodeMorph. One of them is:

	aspect := #selector.
	adapter := [:selector| target methodClass name , '.' , self
selectorWithArguments ].

The block return a String and I guess the right code should be

	aspect := #selector.
	adapter := [:selector| (target methodClass name , '.' , self
selectorWithArguments) asText ]


I opened an Issue: http://code.google.com/p/pharo/issues/detail?id=3031
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20101001/57c37215/attachment-0001.html>

More information about the Pharo-dev mailing list