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

NTuple{N}(v) silently truncates when length(v) > N #52963

Closed
tpapp opened this issue Jan 18, 2024 · 1 comment
Closed

NTuple{N}(v) silently truncates when length(v) > N #52963

tpapp opened this issue Jan 18, 2024 · 1 comment
Labels
kind:duplicate Indicates similar issues or pull requests

Comments

@tpapp
Copy link
Contributor

tpapp commented Jan 18, 2024

julia> NTuple{3}(zeros(4))
(0.0, 0.0, 0.0)

Is this intentional? I expected an error message. Cf eg

julia> NTuple{3}((1,2,3,4))
ERROR: MethodError: Cannot `convert` an object of type 
  NTuple{4, Int64} to an object of type 
  Tuple{T, T, T} where T

(tested on 1.10 and master, but this is not a regression, also the same in previous versions I checked)

@nsajko
Copy link
Contributor

nsajko commented Jan 18, 2024

Dup of #52657

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:duplicate Indicates similar issues or pull requests
Projects
None yet
Development

No branches or pull requests

2 participants