Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finder example search break with two argument keyword selectors. #5290

Closed
kasperosterbye opened this issue Dec 2, 2019 · 1 comment · Fixed by #5293
Closed

Finder example search break with two argument keyword selectors. #5290

kasperosterbye opened this issue Dec 2, 2019 · 1 comment · Fixed by #5293

Comments

@kasperosterbye
Copy link
Contributor

@kasperosterbye kasperosterbye commented Dec 2, 2019

If I ask the finder to solve 'abcdef'. 2. 4. 'bcd', or 'ababa' . $a . $z . 'zbzbz' (from issue #5189), it finds the method, but gives a primitive failure when trying to expand the result.
image

The problem lies in the:

FinderExampleMethodNode>>receiver
	| index rec |
	index := self item findString: self selector.
	rec := self item copyFrom: 1 to: index - 1.
	^ Smalltalk compiler evaluate: rec

The selector is not found in the first line because it is a two keyword selector.

@kasperosterbye

This comment has been minimized.

Copy link
Contributor Author

@kasperosterbye kasperosterbye commented Dec 2, 2019

It will never be stable to use findString:. An other more subtle error is 'asInteger1234'. 1234.

kasperosterbye added a commit to kasperosterbye/pharo that referenced this issue Dec 2, 2019
Use the compiler instead of string manipulation - it is more robust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.