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

WAPharoInspector cannot evaluate (compile) expressions in Pharo 11 #1372

Closed
eMaringolo opened this issue Jul 25, 2023 · 1 comment
Closed

Comments

@eMaringolo
Copy link
Contributor

Every time you attempt to evaluate something in the WAPharoInspector you get Error: Receiver is not same as context receiver, this might be due to some changes in the Opal Compiler.

It can be fixed by adding a semantic scope to the compiler:

WAPharoInspector>>#evaluate

    ^self object class compilerClass new
       source: input;
       context: thisContext;
       semanticScope: (OCReceiverDoItSemanticScope targetingReceiver: self object); "<-- this"
       receiver: self object;
       evaluate
@jbrichau
Copy link
Member

Thanks @eMaringolo for reporting and proposing a solution.

I'm looking into this and notice that it works without the change in Pharo12 because the receiver: method is essentially doing the same thing. In Pharo 11, it fails because the context was set to thisContext which actually does not make sense to me though it has been like this for over 10 years 🙄

jbrichau added a commit that referenced this issue Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants