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

AutoSized Array Bounds in Declarations #24440

Closed
damianmoz opened this issue Feb 20, 2024 · 1 comment
Closed

AutoSized Array Bounds in Declarations #24440

damianmoz opened this issue Feb 20, 2024 · 1 comment

Comments

@damianmoz
Copy link

The declaration

const x = [ 1, 2, 3, 4, 5 ];

automatically deduces the upper bound of x but mandates a lower bound of 0

It would be useful if the following syntax (or something like it using a legal range) was legal:

const x : [0..] int = [ 1, 2, 3, 4, 5];

This would then allow declarations like

const x : [1..] int = [ 1, 2, 3, 4, 5];
const edge : [-1..] = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0 ];

for those of us who work with arrays that are not always 0-based, especially those who port old code from other languages.

Not urgent. Not critical. No temporary workaround needed. Thanks.

@damianmoz
Copy link
Author

damianmoz commented Feb 23, 2024

Closing this - #10596 covers this,

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

No branches or pull requests

3 participants