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

satisfies? does not recognize marker protocol extend'd to record #743

Closed
frenchy64 opened this issue May 19, 2022 · 0 comments
Closed

satisfies? does not recognize marker protocol extend'd to record #743

frenchy64 opened this issue May 19, 2022 · 0 comments

Comments

@frenchy64
Copy link

version

./bb --version
babashka v0.8.3-SNAPSHOT

platform

uname -a
Darwin AmbrosesMBP2020.lan 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64

problem

satisfies? should return true if the value implements the protocol. If the value implements the protocol via extend AND the protocol has zero methods, returns false incorrectly.

repro

./bb
Babashka v0.8.3-SNAPSHOT REPL.
Use :repl/quit or :repl/exit to quit the REPL.
Clojure rocks, Bash reaches.

user=> (defprotocol Marker)
#'user/Marker
user=> (defrecord R [])
#'user/R
user=> (extend-type R Marker)
nil
user=> (satisfies? Marker (R.))
false

expected behavior

clj
Clojure 1.11.1
user=>  (defprotocol Marker)
Marker
user=> (defrecord R [])
user.R
user=> (extend-type R Marker)
nil
user=> (satisfies? Marker (R.))
true
borkdude added a commit to babashka/babashka that referenced this issue May 19, 2022
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

1 participant