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

Another missing getindex method for NamedTuple and StaticSymbol #124

Closed
ianfiske opened this issue Feb 7, 2024 · 0 comments · Fixed by #123
Closed

Another missing getindex method for NamedTuple and StaticSymbol #124

ianfiske opened this issue Feb 7, 2024 · 0 comments · Fixed by #123
Labels
bug Something isn't working

Comments

@ianfiske
Copy link
Contributor

ianfiske commented Feb 7, 2024

Describe the bug 🐞

Similar to #120, given the README, I expected to use StaticSymbols like symbols, but one more method is missing: nt[(static(:a), static(:b))] where nt is a NamedTuple.

Expected behavior

nt = (a=1,b=2,c=2)
nt[(static(:a),static(:b))]

should return (a = 1, b = 2) as with regular Symbols.

Minimal Reproducible Example 👇

Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.

nt = (a=1,b=2,c=2)
nt[(static(:a),static(:b))]

Error & Stacktrace ⚠️

ERROR: MethodError: no method matching getindex(::@NamedTuple{a::Int64, b::Int64, c::Int64}, ::Tuple{StaticSymbol{:a}, StaticSymbol{:b}})

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
Status `/private/var/folders/qz/zw4jl7jx2zgdcsj_6xhrkcmr0000gp/T/jl_2oOGdg/Project.toml`
  [aedffcd0] Static v0.8.9
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
Status `/private/var/folders/qz/zw4jl7jx2zgdcsj_6xhrkcmr0000gp/T/jl_2oOGdg/Manifest.toml`
  [615f187c] IfElse v0.1.1
  [aedffcd0] Static v0.8.9
  • Output of versioninfo()
Julia Version 1.10.0
Commit 3120989f39b (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 10 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
  Threads: 1 on 8 virtual cores
Environment:
  LD_LIBRARY_PATH = :/opt/homebrew/Cellar/r/4.2.1_4/lib/R/lib

Additional context

Thanks for fixing that last one so quickly by the way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant