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

BUG: compiler allows 0 to be specified as a slice index #11

Open
legezam opened this issue Feb 23, 2021 · 0 comments
Open

BUG: compiler allows 0 to be specified as a slice index #11

legezam opened this issue Feb 23, 2021 · 0 comments
Assignees

Comments

@legezam
Copy link

legezam commented Feb 23, 2021

Although slicing syntax uses 1 based indexing for use convenience, it allows the user to specify 0 as an index, so foo2 and foo5 below compiles without any issues:

#refgenome cenpk
#warnoff zeronine
#linkers D0,D5,D6,D9|
#platform stitch
#name foo1
gHO[1:100] // ATG...
#name foo2
gHO[0:100] // ATG..  == foo1
#name foo3
gHO[-1:100] // A ATG...
#name foo4
gHO[1AE:5AE] // AAT...
#name foo5
gHO[0AE:5AE] // AAT... == foo4
#name foo6
gHO[-1AE:5AE] // TAA ATG...

Not a big deal but it should disallow this and raise a compilation error such as: Slice index cannot be zero

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

No branches or pull requests

1 participant