Skip to content

RemoteModel should define repositoryModel (explicit trait requirement) #1917

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

Open
wants to merge 3 commits into
base: Pharo13
Choose a base branch
from

Conversation

guillep
Copy link
Member

@guillep guillep commented Mar 28, 2025

Just add a getter

Actually, the issue is that the superclass defines the method.
But the subclass imports the trait and the explicitRequirement redefines the method.

I reposted a fix that only not imports the conflicting explicit requirement method.

Also, add a hash to the class that defines equals.

@guillep
Copy link
Member Author

guillep commented Mar 28, 2025

After some analysis, the issue here is that explicitRequirement has been deprecated!

explicitRequirement
	"If one of the superclasses can perform the selector, we execute the method of that class, otherwise, the explicit requirement error is thrown"

	<debuggerCompleteToSender>
	| sender |
	
	self deprecated: 'This method will be removed in the future version of Pharo. See https://github.com/pharo-project/pharo/issues/15507 for details'.

	sender := thisContext sender.
	[ sender return: (self perform: sender selector withArguments: sender arguments inSuperclass: sender methodClass superclass) ]
		on: MessageNotUnderstood
		do: [ self error: 'Explicitly required method' ]

The thing is, for this kind of scenarios the deprecation gets called first, then the method in the superclass...
Of course, not importing the explicitRequirement method avoids calling the deprecation.

@guillep guillep force-pushed the fix-repository-model branch from 4ed6a4f to d75716d Compare March 28, 2025 11:10
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

Successfully merging this pull request may close these issues.

1 participant