is out-of-bounds in tuple of length,but the introduction in the document can be out of bounds
See original GitHub issueTypeScript Version: 3.2.0 Code This is the official demo
// Declare a tuple type
let x: [string, number];
// Actually,this code will throw error
x[3] = 'world'; // OK, 'string' can be assigned to 'string | number'
Expected behavior: I want to know if this is a bug or this is document error
Actual behavior:
Tuple out of bounds will trow error, but document say When accessing an element outside the set of known indices, a union type is used instead
Related Issues: NO
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Tuple index out of bounds - Stack Overflow
I am trying to use Recursive Templates for calculating the sum of elements in a tuple. But i keep running into an error...
Read more >Understanding Tuples in Python 3 | DigitalOcean
Introduction. A tuple is a data structure that is an immutable, or unchangeable, ordered sequence of elements. Because tuples are immutable, ...
Read more >indexerror: Single positional indexer is out-of-bounds Error
When we deal with compound data types like lists and tuples or data sets having rows and columns in data science, we frequently...
Read more >Tuple Objects — Python 3.11.1 documentation
Return true if p is a tuple object, but not an instance of a subtype of the tuple ... If pos is negative...
Read more >Solidity Documentation - Read the Docs
but they can be efficiently accessed from outside the blockchain. Since some part of the log data is stored in bloom.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Aye, the docs are out of date - I think tuples became fixed length around TS 2.5.
should fix that obvious mistake