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

LArrays with the same field name can be constructed without error #164

Open
Denis-Titov opened this issue Nov 20, 2024 · 1 comment
Open
Labels

Comments

@Denis-Titov
Copy link

Describe the bug 🐞

Not sure if this is expected but LArray with identical repeated field names can be constructed using code in MWE.

Expected behavior

I would have expected to get an error if LArray has the same field names as if you use the constructor:

julia> LVector(test = 1, test = 2)
ERROR: syntax: keyword argument "test" repeated in call to "LVector" around REPL[7]:1
Stacktrace:
 [1] top-level scope
   @ REPL[7]:1

Minimal Reproducible Example 👇

using LabelledArrays

test_LArray1 = LVector(test = 1)
test_LArray2 = LVector(test = 2)
combined_LArray = [test_LArray1; test_LArray2]
@show combined_LArray

Error & Stacktrace ⚠️
n/a

Environment (please complete the following information):

  • Output of using Pkg; Pkg.status()
  • Output of using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
  • Output of versioninfo()
julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (x86_64-apple-darwin22.4.0)
  CPU: 4 × Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
Environment:
  JULIA_EDITOR = code
  JULIA_NUM_THREADS = 4

Additional context

Add any other context about the problem here.

@ChrisRackauckas
Copy link
Member

not expected. We should validate and error on that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants