8000 Skip instrumenting primitive fns by frenchy64 · Pull Request #1176 · metosin/malli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Skip instrumenting primitive fns #1176

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

Merged
merged 7 commits into from
Apr 15, 2025

Conversation

frenchy64
Copy link
Collaborator
@frenchy64 frenchy64 commented Mar 12, 2025

Closes #859

Throwing seems too disruptive given that it's common to instrument everything.

Other changes:

  • move -find-var test to the outside so -filter-var never fails to pass a var
  • precompute -find-ns set for improved performance

@frenchy64 frenchy64 changed the title Throw when instrumenting primitive fns Skip instrumenting primitive fns Mar 12, 2025
@frenchy64 frenchy64 marked this pull request as ready for review March 12, 2025 05:47
@frenchy64 frenchy64 requested review from opqdonut and ikitommi March 13, 2025 03:40
Copy link
Member
@opqdonut opqdonut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I prefer the warning to an exception as well. Good fix.

Two questions.

@@ -509,6 +509,8 @@ Turning instrumentation on:
; =throws=> :malli.core/invalid-output {:output [:int {:max 6}], :value 11, :args [10], :schema [:=> [:cat :int] [:int {:max 6}]]}
```

Note that functions with JVM primitive param or return type hints will not be instrumented.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the bb exception be mentioned here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know bb won't create a primitive function, but I'm not sure if it can reach vars that contain them. I changed the documentation to be more specific to handle that.

@frenchy64 frenchy64 requested a review from opqdonut March 13, 2025 22:24
@opqdonut opqdonut merged commit 1bbbac7 into metosin:master Apr 15, 2025
13 checks passed
@opqdonut
Copy link
Member

sorry for the delay in merging 😅

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.

Instrumentation of fns with primitive type hints fails
2 participants
0