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

Extend isinteger(::StaticInt) (#93) #94

Merged
merged 1 commit into from
Dec 3, 2022
Merged

Extend isinteger(::StaticInt) (#93) #94

merged 1 commit into from
Dec 3, 2022

Conversation

Tokazama
Copy link
Collaborator

@Tokazama Tokazama commented Dec 3, 2022

No description provided.

@codecov
Copy link

codecov bot commented Dec 3, 2022

Codecov Report

Merging #94 (018a834) into master (ca1f741) will increase coverage by 0.28%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #94      +/-   ##
==========================================
+ Coverage   99.13%   99.42%   +0.28%     
==========================================
  Files           3        3              
  Lines         695      696       +1     
==========================================
+ Hits          689      692       +3     
+ Misses          6        4       -2     
Impacted Files Coverage Δ
src/Static.jl 99.28% <100.00%> (+0.48%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ChrisRackauckas
Copy link
Member

Check the invalidations

@Tokazama
Copy link
Collaborator Author

Tokazama commented Dec 3, 2022

Check the invalidations

It passed invalidation tests so I'm not sure what you mean. Was there a something specific from the invalidation tests you wanted me to see?

@ChrisRackauckas
Copy link
Member

Didn't see. Cool, then this seems good.

@Tokazama Tokazama merged commit 4ce6735 into master Dec 3, 2022
@Tokazama Tokazama deleted the isinteger branch December 3, 2022 13:48
@jishnub
Copy link
Contributor

jishnub commented Dec 4, 2022

Shouldn't this be for StaticIntegers instead of StaticInts? Currently,

julia> static(true) |> isinteger
ERROR: MethodError: no method matching isinteger(::True)
Closest candidates are:
  isinteger(::Integer) at number.jl:20
  isinteger(::Complex) at complex.jl:145
  isinteger(::Rational) at rational.jl:267
  ...
Stacktrace:
 [1] |>(x::True, f::typeof(isinteger))
   @ Base ./operators.jl:911
 [2] top-level scope
   @ REPL[12]:1

julia> true |> isinteger
true

Also, perhaps it should be more general than that, so that something like static(2.0) |> isinteger works as well.

@Tokazama
Copy link
Collaborator Author

Tokazama commented Dec 5, 2022

If it doesn't cause anymore invalidations that's probably fine. The fate of StaticBool is a bit uncertain to me at the moment. It's sort of a trait that acts like Bool

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.

3 participants