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

Protocol method return type hints can't be primitive #101

Open
puredanger opened this issue Jun 4, 2024 · 1 comment
Open

Protocol method return type hints can't be primitive #101

puredanger opened this issue Jun 4, 2024 · 1 comment

Comments

@puredanger
Copy link

As we were working on this issue https://clojure.atlassian.net/browse/CLJ-2698, we were looking in the world for cases of defprotocol methods with ^double and ^long return type hints (which are not valid - protocol methods always return Object) and found PECount in tech.v3.datatype.protocols - I would recommend removing the type hints as it is not valid. I am not expecting any change in behavior in Clojure in 1.12.

@cnuernber
Copy link
Owner

Thanks Alex for the notification - its odd that arguments to the protocol functions can be primitives but the return type cannot be.

I think there is a pretty good argument for removing the protocol callsite 'optimization' from the compiler entirely and then making this just work as expected.

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