Expose indexing as a language interface (#4370)

This PR makes it so that types can implement the `IndexWith` interface
so that they can provide their custom indexing behavior.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
This commit is contained in:
Brymer MenesesandJon Ross-Perkins authored and GitHub committed 2024-10-29 21:25:02 +00:00
1 parent c30b1d1124
commit 89eed4220f
464 files changed
+2506 -29

No files matched your search

+1
View File
@@ -44,6 +44,7 @@ fn G() -> i32 {
// CHECK:STDOUT: import Core//prelude/types
// CHECK:STDOUT: import Core//prelude/operators/arithmetic
// CHECK:STDOUT: import Core//prelude/operators/as
// CHECK:STDOUT: import Core//prelude/operators/index
// CHECK:STDOUT: import Core//prelude/operators/bitwise
// CHECK:STDOUT: import Core//prelude/operators/comparison
// CHECK:STDOUT: import Core//prelude/types/bool