You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arrays and Slices has an example at the bottom of the code example of an index out of bounds error, and the comment implies that it will cause a compiler error if you uncomment the line. But if you go ahead and uncomment the line the example will compile just fine and run until it panics because of the out of bounds error.
I figured out that all of the lines that borrow the xs value seem to be what interferes with the compilers ability to preemptively catch the error, but it was pretty confusing to me as someone who doesn't work with compilers all that extensively.
The text was updated successfully, but these errors were encountered:
Arrays and Slices has an example at the bottom of the code example of an index out of bounds error, and the comment implies that it will cause a compiler error if you uncomment the line. But if you go ahead and uncomment the line the example will compile just fine and run until it panics because of the out of bounds error.
I figured out that all of the lines that borrow the
xs
value seem to be what interferes with the compilers ability to preemptively catch the error, but it was pretty confusing to me as someone who doesn't work with compilers all that extensively.The text was updated successfully, but these errors were encountered: